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

Re: [Xen-devel] [PATCH v3 13/31] libxl_qmp: Separate QMP message generation from qmp_send_prepare



On Wed, Jun 27, 2018 at 03:45:33PM +0100, Ian Jackson wrote:
> Anthony PERARD writes ("[PATCH v3 13/31] libxl_qmp: Separate QMP message 
> generation from qmp_send_prepare"):
> > This new function qmp_prepare_qmp_cmd() can be reuse later when
> > introducing a different way to communicate with a QMP server,
> > libxl__ev_qmp.
> > 
> > Also, add the QMP end of command '\r\n' into the generated string.
> 
> Would it be terribly inconvenient if this function
> 
> > +static char *qmp_prepare_qmp_cmd(libxl__gc *gc,
> > +                                 const char *cmd,
> > +                                 const libxl__json_object *args,
> > +                                 int id,
> > +                                 size_t *len_r)
> ...
> > +    ret = libxl__malloc(NOGC, len + 3);
> 
> actually used its incoming gc ?

Yes, because I wanted to keep the allocated buffers until it is actually
sent. But maybe we could provide a different gc, but I'm not sure which
one or how to get it.

That function is going to be called by:
> libxl__ev_qmp_register(libxl__gc *gc, libxl__ev_qmp *ev, ....)
introduce in the patch "libxl_qmp: Introduce libxl__ev_qmp functions"

> Perhaps it needs a 2nd gc argument ?
> 
> I think for future we should be using some appropriate ao gc, or
> something, for these buffers.  But, anyway, that is a future
> improvement, and not a blocker for this patch.

Sure.

> So:
> 
> Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

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