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

Re: [Xen-devel] [PATCH] opw: libxl: change remaining LIBXL_LOG to LOG in libxl_qmp.c



On Sat, 2013-11-09 at 20:05 -0800, Kelley Nielsen wrote:
> Code cleanup -- no functional changes
> 
> Coding style has recently been changed for libxl. The convenience
> macro LOG() has been introduced, and invocations of the old macro
> LIBXL__LOG() are to be replaced with it. Change all remaining
> occurences of the old macro to the new one. These are in functions
> that do not have a local libxl__gc *gc, so create one by calling
> GC_INIT() at the top of the function and destroy it by calling
> GC_FREE at the end. In functions that have multiple exits, create
> a labeled set of statements at the end with GC_FREE and the
> return statement, and route all exits through it with gotos.
> 
> Signed-off-by: Kelley Nielsen <kelleynnn@xxxxxxxxx>

Thanks but I'm afraid I don't think this is the correct approach.

The GC should normally be created upon entry into the library and
cleaned up on return to the application. So I think the correct approach
here would be to plumb through the gc from the callers. e.g. in the
qmp_synchronous_send case that would mean adding a gc parameter to
libxl__qmp_query_serial and _vnc and passing the gc from
libxl__qmp_initializations, as well as passing in the existing gc from
qmp_run_command, libxl__qmp_pci_add and qmp_change (plus any I have
missed)

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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