aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2018-10-17 10:26:56 +0200
committerMarkus Armbruster <armbru@redhat.com>2018-10-19 14:51:34 +0200
commitf881ca19f1942965490a70d23566c6287c49ceac (patch)
tree2866bc15acb9cb53d5caa5d9a4f2e31f5ad47031
parentb836723dfe642a67904bcd047feaaa0cda662d38 (diff)
downloadqemu-arm-f881ca19f1942965490a70d23566c6287c49ceac.tar.gz
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>
-rw-r--r--vl.c4
1 files changed, 1 insertions, 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;
}