mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-02-02 06:10:39 -07:00
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:
parent
b836723dfe
commit
f881ca19f1
1 changed files with 1 additions and 3 deletions
4
vl.c
4
vl.c
|
|
@ -1156,9 +1156,7 @@ static void default_drive(int enable, int snapshot, BlockInterfaceType type,
|
|||
}
|
||||
|
||||
dinfo = drive_new(opts, type);
|
||||
if (!dinfo) {
|
||||
exit(1);
|
||||
}
|
||||
assert(dinfo);
|
||||
dinfo->is_default = true;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue