aboutsummaryrefslogtreecommitdiffstats
path: root/tools/hotplug
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-07-01 10:53:15 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-07-01 10:53:15 +0100
commit286423408d7a6b4bd427a2b3a60474e6bce95f66 (patch)
tree22e27e2290c8b8d15e76b2e148bb620ea35b2dc2 /tools/hotplug
parent756b7b81f963dfc25d5ced1f54b068a8cc6df14e (diff)
downloadxen-286423408d7a6b4bd427a2b3a60474e6bce95f66.tar.gz
xen-286423408d7a6b4bd427a2b3a60474e6bce95f66.tar.bz2
xen-286423408d7a6b4bd427a2b3a60474e6bce95f66.zip
blktap2: add blktap2 device class and device controller
blktap2 devices must be handled differently than blktap2 devices. blktap2 devices require a sysfs write to close the underlying device, as well as extra sysfs writes when the domU is paused/unpaused. The differences between blktap1 and blktap2 are great enough to warrant the creation of a new device class, 'tap2', and device controller for blktap2 devices. * add a new device controller (Blktap2Controller) and device class (tap2) for blktap2 devices * move blktap2 specific code from DevController to Blktap2Controller * if possible, check xenstore to determine block device class * use vmpath (/vm/<uuid>/) when releasing devices * modify linux hotplug cleanup script to handle blktap2 device removal Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
Diffstat (limited to 'tools/hotplug')
-rw-r--r--tools/hotplug/Linux/xen-hotplug-cleanup7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/hotplug/Linux/xen-hotplug-cleanup b/tools/hotplug/Linux/xen-hotplug-cleanup
index 0cb86d27ec..f4d016232d 100644
--- a/tools/hotplug/Linux/xen-hotplug-cleanup
+++ b/tools/hotplug/Linux/xen-hotplug-cleanup
@@ -18,6 +18,13 @@ vm=$(xenstore_read_default "/local/domain/${path_array[2]}/vm" "")
# construct /vm/UUID/device/DEVCLASS/DEVID
if [ "$vm" != "" ]; then
vm_dev="$vm/device/${path_array[1]}/${path_array[3]}"
+
+ # if the vm path does not exist and the device class is 'vbd' then we may have
+ # a tap2 device
+ if [ ! $(xenstore-read "vm_dev" 2>/dev/null) ] \
+ && [ "${path_array[1]}" = "vbd" ]; then
+ vm_dev="$vm/device/tap2/${path_array[3]}"
+ fi
else
vm_dev=
fi