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

Re: [Xen-devel] [PATCH 1/3] libxl, xl: don't init/dispose when not necessary



On Tue, Feb 10, 2015 at 10:54:47AM +0000, Ian Jackson wrote:
> Wei Liu writes ("[PATCH 1/3] libxl, xl: don't init/dispose when not 
> necessary"):
> > Functions like libxl__device_disk_from_xs_be and
> > libxl_vdev_to_device_disk should not touch the disk struct passed in.
> > It's caller's responsibility to do that.
> ...
> > Note that libxl_vdev_to_device_disk is a public API so a macro is
> > defined in libxl.h to indicate the change of behaviour.
> 
> I don't think this is really on, in the public API.
> 

Yes, it's public API -- not in libxl.h, but in libxl_utils.h. And xl is
using it.

The problem is that calling _init inside libxl_vdev_to_device_disk
violates our pattern of using libxl types.

> Why not make libxl_..._free idempotent ?  Then extra calls to _init
> are harmless.
> 

That would be a good idea and it should be done in a separate patch set.

Strictly speaking this patch is not required to fix the bug Jim spotted.
I will just drop it in this series and rework in while I make _dispose
idempotent.

Wei.

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