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

Re: [Xen-devel] [RFC v2 7/9] libxl_qmp: Implement query-status command



On Mon, Apr 16, 2018 at 06:32:25PM +0100, Anthony PERARD wrote:
> It check via QMP if QEMU as reach the intended status.

Some typos.

"... checks ... if QEMU has reached ..."

> 
> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> ---
>  tools/libxl/libxl_internal.h |  3 +++
>  tools/libxl/libxl_qmp.c      | 39 ++++++++++++++++++++++++++++++++++++
>  2 files changed, 42 insertions(+)
> 
> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
> index 6352380644..3764d26463 100644
> --- a/tools/libxl/libxl_internal.h
> +++ b/tools/libxl/libxl_internal.h
> @@ -1857,6 +1857,9 @@ _hidden int libxl__qmp_nbd_server_stop(libxl__gc *gc, 
> int domid);
>  _hidden int libxl__qmp_x_blockdev_change(libxl__gc *gc, int domid,
>                                           const char *parant,
>                                           const char *child, const char 
> *node);
> +_hidden int libxl__qmp_query_status(libxl__gc *gc,
> +                                    int domid,
> +                                    const char *intended_status);
>  /* run a hmp command in qmp mode */
>  _hidden int libxl__qmp_hmp(libxl__gc *gc, int domid, const char 
> *command_line,
>                             char **out);
> diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c
> index 3bb0f28bea..83bd804219 100644
> --- a/tools/libxl/libxl_qmp.c
> +++ b/tools/libxl/libxl_qmp.c
> @@ -1246,6 +1246,45 @@ int libxl__qmp_x_blockdev_change(libxl__gc *gc, int 
> domid, const char *parent,
>      return qmp_run_command(gc, domid, "x-blockdev-change", args, NULL, NULL);
>  }
>  
> +static int qmp_check_status(libxl__qmp_handler *qmp,
> +                            const libxl__json_object *response,
> +                            void *opaque)
> +{
> +    char **status = opaque;
> +    GC_INIT(qmp->ctx);
> +    const libxl__json_object *o;
> +
> +    o = libxl__json_map_get("status", response, JSON_STRING);
> +    if (!o)
> +        return 1;
> +    *status = libxl__strdup(gc, libxl__json_object_get_string(o));

Missing GC_FREE in the exit paths.

The rest looks OK.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.