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

Re: [Xen-devel] [PATCH v1 06/12] libxl: add support for different hotplug interfaces



On 13/03/13 17:17, Ian Jackson wrote:
> Roger Pau Monne writes ("[Xen-devel] [PATCH v1 06/12] libxl: add support for 
> different hotplug interfaces"):
>> Add a new variable to libxl_device_disk "hotplug_version", that will
>> be automatically set to the detected hotplug script interface version.
> ...
>> +    /*
>> +     * We might have devices that have been prepared, but with no
>> +     * frontend xenstore entries, so domain destruction fails to
>> +     * find them, that is why we have to unprepare them manually.
>> +     */
>> +    libxl__multidev_begin(ao, &dcs->multidev);
>> +    dcs->multidev.callback = domcreate_unprepare_cb;
>> +    libxl__unprepare_disks(egc, ao, domid, d_config, &dcs->multidev);
>> +    libxl__multidev_prepared(egc, &dcs->multidev, 0);
>> +    return;
> 
> I don't think this is correct.  What if the calling application
> crashes and this code is never executed ?  Then libxl_destroy would
> leak this state.
> 
> So I think you need to record the preparedness somewhere where
> libxl_destroy can find it.

Right, I've added a new xenstore path that has the following nomenclature:

/libxl/<domid>/hotplug/status/<devid>

Note that it doesn't contain the backend domid, so it can be parsed
inside libxl__devices_destroy in order to find devices using the new
hotplug interface (even devices that have been prepared but not attached
to the domain).

This path is created after the device has been prepared, and is cleaned
after the device has been unprepared. It only contains the necessary
information to be able to fill a libxl__device struct.


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