qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 29/31] vl: Assert drive_new() does not fail in defau


From: Markus Armbruster
Subject: [Qemu-devel] [PATCH 29/31] vl: Assert drive_new() does not fail in default_drive()
Date: Mon, 8 Oct 2018 19:31:23 +0200

If creating (empty) default drives fails, it's a bug.  Therefore,
assert() is more appropriate than exit(1).

Cc: Kevin Wolf <address@hidden>
Cc: Max Reitz <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
---
 vl.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/vl.c b/vl.c
index 4aa976c4cc..0d25956b2f 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.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]