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

Re: [Xen-devel] [PATCH v4 20/32] libxl_qmp: Handle write to QMP socket



On Fri, Jul 27, 2018 at 03:06:02PM +0100, Anthony PERARD wrote:
> The libxl__ev_qmp_* will now send the command to QEMU when the socket is
> ready for writes.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

> ---
>  tools/libxl/libxl_qmp.c | 44 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
> 
> diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c
> index 2792f35912..75f953d521 100644
> --- a/tools/libxl/libxl_qmp.c
> +++ b/tools/libxl/libxl_qmp.c
> @@ -1326,6 +1326,8 @@ static int qmp_ev_prepare_cmd(libxl__gc *gc,
>      ev->tx_buf = buf;
>      ev->tx_buf_len = len;
>  
> +    libxl__ev_fd_modify(gc, &ev->qmp_efd, ev->qmp_efd.events | POLLOUT);
> +
>      return 0;
>  }
>  
> @@ -1435,6 +1437,43 @@ static int qmp_ev_callback_readable(libxl__egc *egc, 
> libxl__ev_qmp *ev, int fd)
>      return 0;
>  }
>  
> +static int qmp_ev_callback_writable(libxl__gc *gc, libxl__ev_qmp *ev, int fd)
> +{
> +    int rc;
> +    char *buf;
> +    size_t len;
> +    int buf_fd = -1;

I would name this send_fd.

> +
> +    /* No need to call qmp_ev_callback_writable again, everything that needs 
> to
> +     * be send for now will be in this call. */
> +    libxl__ev_fd_modify(gc, &ev->qmp_efd, ev->qmp_efd.events & ~POLLOUT);

I think you do this because you need to wait for this command to
complete before queuing another command?

Thanks, Roger.

_______________________________________________
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®.