diff options
author | Markus Armbruster <armbru@redhat.com> | 2018-10-17 10:26:56 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2018-10-19 14:51:34 +0200 |
commit | f881ca19f1942965490a70d23566c6287c49ceac (patch) | |
tree | 2866bc15acb9cb53d5caa5d9a4f2e31f5ad47031 /vl.c | |
parent | b836723dfe642a67904bcd047feaaa0cda662d38 (diff) | |
download | qemu-f881ca19f1942965490a70d23566c6287c49ceac.zip qemu-f881ca19f1942965490a70d23566c6287c49ceac.tar.gz qemu-f881ca19f1942965490a70d23566c6287c49ceac.tar.bz2 |
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>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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; } |