vl: Assert drive_new() does not fail in default_drive()

If creating (empty) default drives fails, it's a bug.  Therefore,
assert() is more appropriate than exit(1).

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20181017082702.5581-33-armbru@redhat.com>
This commit is contained in:
Markus Armbruster 2018-10-17 10:26:56 +02:00
parent b836723dfe
commit f881ca19f1

4
vl.c
View File

@ -1156,9 +1156,7 @@ static void default_drive(int enable, int snapshot, BlockInterfaceType type,
} }
dinfo = drive_new(opts, type); dinfo = drive_new(opts, type);
if (!dinfo) { assert(dinfo);
exit(1);
}
dinfo->is_default = true; dinfo->is_default = true;
} }