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

Re: [Xen-devel] [PATCH v1 08/12] libxl: add disk specific remove functions



On 13/03/13 17:22, Ian Jackson wrote:
> Roger Pau Monne writes ("[Xen-devel] [PATCH v1 08/12] libxl: add disk 
> specific remove functions"):
>> Add a specific macro to generate libxl_device_disk_{remove/destroy}
>> functions that passes the hotplug_version field down to the aodev
>> struct.
> 
>> +/* Specific for disk devices, that have to set aodev->hotplug_version */
>> +#define DEFINE_DISK_REMOVE(type, removedestroy, f)                      \
>> +    int libxl_device_##type##_##removedestroy(libxl_ctx *ctx,           \
> 
> This macro is very similar to DEFINE_DEVICE_REMOVE.  The only
> difference seems to be these extra lines:
> 
>> +        aodev->hotplug.version = type->hotplug_version;                 \
>> +        LOG(DEBUG, "hotplug version: %d", aodev->hotplug.version);      \
>> +        libxl__initiate_device_remove(egc, aodev);                      \
> 
> Perhaps the right answer would be to add a new formal parameter to
> DEFINE_DEVICE_REMOVE which allows DEFINE_DEVICE_REMOVE's user to
> specify some extra code here ?

type->hotplug_version is only available in libxl_device_disk, so even if
using something like

if (param)
        aodev->hotplug.version = type->hotplug_version;

Would break compilation because other device types don't have the
hotplug_version field (and adding a hotplug_version field to all device
structures seems overkill).


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