[Qemu-devel] [PATCH] qapi/qmp-dispatch: fix return value in do_qmp_dispatch

Vladimir Sementsov-Ogievskiy posted 1 patch 5 years, 1 month ago
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test asan passed
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190325154748.66381-1-vsementsov@virtuozzo.com
Maintainers: Michael Roth <mdroth@linux.vnet.ibm.com>, Markus Armbruster <armbru@redhat.com>
qapi/qmp-dispatch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] qapi/qmp-dispatch: fix return value in do_qmp_dispatch
Posted by Vladimir Sementsov-Ogievskiy 5 years, 1 month ago
There are no harm but just looks weird to return bool in
pointer-returning function. Introduced in 69240fe62d1 with the whole
failure-checking "if" chunk.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 qapi/qmp-dispatch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
index 5f812bb9f2..e2c366e09e 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -111,7 +111,7 @@ static QObject *do_qmp_dispatch(QmpCommandList *cmds, QObject *request,
     if (oob && !(cmd->options & QCO_ALLOW_OOB)) {
         error_setg(errp, "The command %s does not support OOB",
                    command);
-        return false;
+        return NULL;
     }
 
     if (runstate_check(RUN_STATE_PRECONFIG) &&
-- 
2.18.0


Re: [Qemu-devel] [PATCH] qapi/qmp-dispatch: fix return value in do_qmp_dispatch
Posted by Markus Armbruster 5 years, 1 month ago
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> writes:

> There are no harm but just looks weird to return bool in
> pointer-returning function. Introduced in 69240fe62d1 with the whole
> failure-checking "if" chunk.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>  qapi/qmp-dispatch.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
> index 5f812bb9f2..e2c366e09e 100644
> --- a/qapi/qmp-dispatch.c
> +++ b/qapi/qmp-dispatch.c
> @@ -111,7 +111,7 @@ static QObject *do_qmp_dispatch(QmpCommandList *cmds, QObject *request,
>      if (oob && !(cmd->options & QCO_ALLOW_OOB)) {
>          error_setg(errp, "The command %s does not support OOB",
>                     command);
> -        return false;
> +        return NULL;
>      }
>  
>      if (runstate_check(RUN_STATE_PRECONFIG) &&

Pasto.  Messed up in commit 69240fe62d1 by yours truly.

Reviewed-by: Markus Armbruster <armbru@redhat.com>

and queued.  Thanks!

Re: [Qemu-devel] [PATCH] qapi/qmp-dispatch: fix return value in do_qmp_dispatch
Posted by Eric Blake 5 years, 1 month ago
On 3/25/19 10:47 AM, Vladimir Sementsov-Ogievskiy wrote:
> There are no harm but just looks weird to return bool in
> pointer-returning function. Introduced in 69240fe62d1 with the whole
> failure-checking "if" chunk.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>  qapi/qmp-dispatch.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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

Trivial enough to include in 4.0 if there are other qapi patches needed;
but no semantic change so also harmless if it slips to 4.1.

> 
> diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
> index 5f812bb9f2..e2c366e09e 100644
> --- a/qapi/qmp-dispatch.c
> +++ b/qapi/qmp-dispatch.c
> @@ -111,7 +111,7 @@ static QObject *do_qmp_dispatch(QmpCommandList *cmds, QObject *request,
>      if (oob && !(cmd->options & QCO_ALLOW_OOB)) {
>          error_setg(errp, "The command %s does not support OOB",
>                     command);
> -        return false;
> +        return NULL;
>      }
>  
>      if (runstate_check(RUN_STATE_PRECONFIG) &&
> 

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