From f881ca19f1942965490a70d23566c6287c49ceac Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 17 Oct 2018 10:26:56 +0200 Subject: 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> --- vl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'vl.c') 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; } -- cgit v1.2.3