[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 Thu, Aug 02, 2018 at 01:02:13PM +0200, Roger Pau Monné wrote:
> 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>
> 
> > +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.

I wonder why I renamed it buf_fd ...
I'll change it to 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?

It's actually because there is no queuing with this API. There is really
nothing else to send. A user of the API might want to send something
else, but in the meantime, there is nothing to send.

If (hypothetical) there were a queue, everything in the queue could be
sent, without waiting for qemu to respond, and I would turn of the
POLLOUT bit only when the queue was empty.

Thanks,

-- 
Anthony PERARD

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