From: Markus Armbruster Date: Wed, 17 Oct 2018 08:26:56 +0000 (+0200) Subject: vl: Assert drive_new() does not fail in default_drive() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f881ca19f1942965490a70d23566c6287c49ceac;p=qemu.git 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 Cc: Max Reitz Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Max Reitz Message-Id: <20181017082702.5581-33-armbru@redhat.com> --- diff --git a/vl.c b/vl.c index 7cd35d2c37..fbbae766d5 100644 --- a/vl.c +++ b/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; }