If creating (empty) default drives fails, it's a bug. Therefore, assert() is more appropriate than exit(1).
Cc: Kevin Wolf <kw...@redhat.com> Cc: Max Reitz <mre...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Max Reitz <mre...@redhat.com> Message-Id: <20181017082702.5581-33-arm...@redhat.com> --- vl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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; } -- 2.17.2