Skip to contentSkip to conversation

libxl device xenstore entries cleanup

DISCUSSION Marek Marczykowski 1 participant 1 message Apr 17, 2013

lore
Share & tools
lore
#0 lore raw

Hi,

Currently libxl removes entries from xenstore "device/" tree only in case of:
a) domain destroy (clean all domain directory)
b) dom0-initiated device remove

But this doesn't cover all the cases. At least this isn't done:
a) backend domain shutdown, backend-initiated remove
b) backend domain destroy (here backend driver doesn't have chance to signal frontend)
c) frontend initiated remove

First two apply only for backends in driver domain of course. The last one can be triggered by xenstore-write device/vbd/DEVID/state 5, but I have a patch which map eject on normal disk (not cdrom) operation to remove.

The "c" case also applies to backend entries.
All of above means that devices with state=6 are left in xenstore, preventing add new device in the same place (eg reattach networking after backend domain restart).

Currently I have workarounded this with python script, which watch all device/*/state entries and clean them up in case of state=6 detected (with some nasty sleep to not race with libxl in case of domain destroy/dom0-initiated remove). But IMO this should be done in libxl toolstack itself.
Perhaps something similar to handling cdrom eject?
Also device remove should generate some event, eg. to allow libvirt update domain configuration state.

Any ideas how to do this? I believe it is too late for 4.3, but perhaps can be backported later?

Signature · 3 lines
Best Regards / Pozdrawiam,
Marek Marczykowski
Invisible Things Lab

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel