Skip to contentSkip to conversation

vl: Use error_fatal to simplify obvious fatal errors (again)

PATCH Applied Markus Armbruster 4 participants 5 messages Dec 13, 2018 – Dec 17, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vl: Use error_fatal to simplify obvious fatal errors (again)

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
---
 vl.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
vl.c +2 -5
index a5ae5f23d2..702a828ca2 100644
@@ -3138,11 +3138,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,
Signature · 1 line
2.17.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Markus Armbruster

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
---
  vl.c | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
Reviewed-by on v1 1/1
#3 lore raw
In reply to Markus Armbruster
Quoted 6 lines · Markus Armbruster

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
Quoted 23 lines
---
 vl.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
vl.c +2 -5
index a5ae5f23d2..702a828ca2 100644
@@ -3138,11 +3138,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,
#4 lore raw
In reply to Markus Armbruster
Quoted 19 lines · Markus Armbruster

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
---
 vl.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
vl.c +0 -0
index a5ae5f23d2..702a828ca2 100644
@@ -3138,11 +3138,8 @@ int main(int argc, char **argv, char **envp)
                     Visitor *v;
                     BlockdevOptions_queue *bdo;
 

vl.c int main(int argc, char **argv, char **envp) · line 3145

Quoted 10 lines
vl.c +2 -5
-                    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,

Applied to my trivial-patches branch.

Thanks,
Laurent