qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC v6 20/27] qmp: export qmp_dispatch_check_obj and a


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [RFC v6 20/27] qmp: export qmp_dispatch_check_obj and allow "id"
Date: Tue, 9 Jan 2018 13:45:28 +0000
User-agent: Mutt/1.9.1 (2017-09-22)

On Tue, Dec 19, 2017 at 04:45:50PM +0800, Peter Xu wrote:
> We need this for earlier check for OOB, before reaching
> do_qmp_dispatch().  Meanwhile, a small touch-up to allow "id" field,
> after all we allow that for sure in the spec (in any form).

This change would be better as part of the patch that needs it.  I don't
understand the commit description and there is no context in this patch
showing how this change is used.

> Signed-off-by: Peter Xu <address@hidden>
> ---
>  include/qapi/qmp/dispatch.h | 1 +
>  qapi/qmp-dispatch.c         | 4 +++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/include/qapi/qmp/dispatch.h b/include/qapi/qmp/dispatch.h
> index b76798800c..cf2657b5c9 100644
> --- a/include/qapi/qmp/dispatch.h
> +++ b/include/qapi/qmp/dispatch.h
> @@ -49,6 +49,7 @@ bool qmp_command_is_enabled(const QmpCommand *cmd);
>  const char *qmp_command_name(const QmpCommand *cmd);
>  bool qmp_has_success_response(const QmpCommand *cmd);
>  QObject *qmp_build_error_object(Error *err);
> +QDict *qmp_dispatch_check_obj(const QObject *request, Error **errp);
>  
>  typedef void (*qmp_cmd_callback_fn)(QmpCommand *cmd, void *opaque);
>  
> diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
> index b41fa174fe..b16f2f1d3f 100644
> --- a/qapi/qmp-dispatch.c
> +++ b/qapi/qmp-dispatch.c
> @@ -20,7 +20,7 @@
>  #include "qapi-types.h"
>  #include "qapi/qmp/qerror.h"
>  
> -static QDict *qmp_dispatch_check_obj(const QObject *request, Error **errp)
> +QDict *qmp_dispatch_check_obj(const QObject *request, Error **errp)
>  {
>      const QDictEntry *ent;
>      const char *arg_name;
> @@ -52,6 +52,8 @@ static QDict *qmp_dispatch_check_obj(const QObject 
> *request, Error **errp)
>                             "QMP input member 'arguments' must be an object");
>                  return NULL;
>              }
> +        } else if (!strcmp(arg_name, "id")) {
> +            continue;
>          } else {
>              error_setg(errp, "QMP input member '%s' is unexpected",
>                         arg_name);
> -- 
> 2.14.3
> 

Attachment: signature.asc
Description: PGP signature


reply via email to

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