]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
vl: Use error_fatal to simplify obvious fatal errors (again)
authorMarkus Armbruster <armbru@redhat.com>
Thu, 13 Dec 2018 17:58:07 +0000 (18:58 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Tue, 18 Dec 2018 13:57:48 +0000 (14:57 +0100)
Patch created mechanically by rerunning:

    $ spatch --in-place --sp-file scripts/coccinelle/use-error_fatal.cocci \
             --macro-file scripts/cocci-macro-file.h vl.c

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181213175807.12039-1-armbru@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
vl.c

diff --git a/vl.c b/vl.c
index 2a8b2ee16de89132301f2bae938515be1526b7eb..530fad6a71348db83918d3f9ccef83091d268f4b 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -3133,11 +3133,8 @@ int main(int argc, char **argv, char **envp)
                     Visitor *v;
                     BlockdevOptions_queue *bdo;
 
-                    v = qobject_input_visitor_new_str(optarg, "driver", &err);
-                    if (!v) {
-                        error_report_err(err);
-                        exit(1);
-                    }
+                    v = qobject_input_visitor_new_str(optarg, "driver",
+                                                      &error_fatal);
 
                     bdo = g_new(BlockdevOptions_queue, 1);
                     visit_type_BlockdevOptions(v, NULL, &bdo->bdo,