Roger Pau Monné
2011-Aug-22 10:26 UTC
[Xen-devel] NetBSD and hotplug scripts synchronization using libxl
Hello, With the introduction of libxl the deletion of all xenstore entries regarding a domU cleanup is done in libxl itself, while in xend the deletion of entries regarding vbd was done in the hotplug scripts. This presents a problem in NetBSD, since there is no synchronization between xbdback (the kernel driver in charge of disconnecting the devices), libxl and the hotplug scripts that actually unmount the images (called from xenbackend user-space daemon). The current flow in NetBSD is the following, typically xbdback reads a CLOSING state from xenbus, disconnects the image and sets the state to CLOSED. And here there''s a race condition between libxl and the hotplug scripts called by xenbackend. Both are watching the state of xenstore entries, and upon detecting a CLOSED state libxl deletes the entry, probably before xenbackend has been able to read it and unmount the image. This is the only problem left to add NetBSD compatibility to libxl, how does this synchronization happen in Linux? I''ve tried looking at the hotplug scripts, but I''m not able to see any kind of sincronization, probably because Linux doesn''t use vbd anymore in libxl, but I think there should also be some kind of synchronization with tapdisk device unmouting. Thanks, Roger. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Aug-26 11:11 UTC
Re: [Xen-devel] NetBSD and hotplug scripts synchronization using libxl
Roger Pau Monné writes ("[Xen-devel] NetBSD and hotplug scripts synchronization using libxl"):> This is the only problem left to add NetBSD compatibility to libxl, > how does this synchronization happen in Linux? I''ve tried looking at > the hotplug scripts, but I''m not able to see any kind of > sincronization, probably because Linux doesn''t use vbd anymore in > libxl, but I think there should also be some kind of synchronization > with tapdisk device unmouting.In libxl, libxl waits for the device to be shut down, and is then responsible for undoing whatever was necessary to make the device available to blkback (ie, what you are calling "unmounting"). For things which start out as block devices nothing needs to be done since blkback can use any block device directly. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel