[Qemu-devel] [PATCH] vl: Use error_fatal to simplify obvious fatal errors (again)

Markus Armbruster posted 1 patch 6 years, 10 months ago
Test checkpatch passed
Test asan passed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test docker-clang@ubuntu passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20181213175807.12039-1-armbru@redhat.com
vl.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
[Qemu-devel] [PATCH] vl: Use error_fatal to simplify obvious fatal errors (again)
Posted by Markus Armbruster 6 years, 10 months ago
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>
---
 vl.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/vl.c b/vl.c
index a5ae5f23d2..702a828ca2 100644
--- a/vl.c
+++ b/vl.c
@@ -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,
-- 
2.17.2


Re: [Qemu-devel] [PATCH] vl: Use error_fatal to simplify obvious fatal errors (again)
Posted by Eric Blake 6 years, 10 months ago
On 12/13/18 11:58 AM, Markus Armbruster wrote:
> 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>
> ---
>   vl.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Re: [Qemu-devel] [Qemu-trivial] [PATCH] vl: Use error_fatal to simplify obvious fatal errors (again)
Posted by Laurent Vivier 6 years, 10 months ago
On 13/12/2018 18:58, Markus Armbruster wrote:
> 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>
> ---
>  vl.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>



Re: [Qemu-devel] [PATCH] vl: Use error_fatal to simplify obvious fatal errors (again)
Posted by Philippe Mathieu-Daudé 6 years, 10 months ago
On 12/13/18 6:58 PM, Markus Armbruster wrote:
> 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: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>  vl.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/vl.c b/vl.c
> index a5ae5f23d2..702a828ca2 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -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,
> 

Re: [Qemu-devel] [Qemu-trivial] [PATCH] vl: Use error_fatal to simplify obvious fatal errors (again)
Posted by Laurent Vivier 6 years, 10 months ago
On 13/12/2018 18:58, Markus Armbruster wrote:
> 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>
> ---
>  vl.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/vl.c b/vl.c
> index a5ae5f23d2..702a828ca2 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -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,
> 

Applied to my trivial-patches branch.

Thanks,
Laurent