Jiri Denemark
2009-Feb-25 15:39 UTC
[Xen-devel] Fix removing /vm/UUID/device paths when device cannot be disconnected
Hi, Currently if a device cannot be disconnected (for example, when trying to xm block-detach a disk which is mounted in domU), its /vm/UUID/device/CLASS/ID path is still removed. The result is that after a failed detach, the device cannot be detached even when using force... An example of bad behavior: xm create guest xm block-attach guest tap:aio:/var/lib/xen/images/disk.img xvdb w # mount /dev/xvdb1 in the guest Than "xm block-detach guest xvdb" fails with something like Error: Device ID (tap) could not be disconnected. Examining xenstore, one can find both xvdb''s backend and frontend are there, but /vm/UUID/device/tap/ID is not. Although "xm block-list guest" would still show the xvdb device, "xm block-detach guest xvdb" would fail with Device ID not connected And it would show it even when --force is used. I''d suggest to change deviceDestroy behavior to remove /vm/UUID/device/... path only when force was used (as it already does so for both frontend and backend) and do the removing from xen-hotplug-cleanup script when we are sure the device is really not attached to the guest any more. Attached is a patch which moves unforced removing to cleanup script. Cheers. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel