diff -r f8187a343ad2 tools/hotplug/Linux/xen-hotplug-cleanup --- a/tools/hotplug/Linux/xen-hotplug-cleanup Fri Feb 20 17:02:36 2009 +0000 +++ b/tools/hotplug/Linux/xen-hotplug-cleanup Wed Feb 25 16:16:07 2009 +0100 @@ -11,6 +11,13 @@ # This is pretty horrible, but there's not really a nicer way of solving this. claim_lock "block" +# split backend/DEVCLASS/VMID/DEVID on slashes +path_array=( ${XENBUS_PATH//\// } ) +# get /vm/UUID path +vm=$(xenstore-read "/local/domain/${path_array[2]}/vm") +# construct /vm/UUID/device/DEVCLASS/DEVID +vm_dev="$vm/device/${path_array[1]}/${path_array[3]}" + # remove device frontend store entries xenstore-rm -t \ $(xenstore-read "$XENBUS_PATH/frontend" 2>/dev/null) 2>/dev/null || true @@ -19,4 +26,7 @@ xenstore-rm -t "$XENBUS_PATH" 2>/dev/null || true xenstore-rm -t "error/$XENBUS_PATH" 2>/dev/null || true +# remove device path from /vm/UUID +xenstore-rm -t "$vm_dev" 2>/dev/null || true + release_lock "block" diff -r f8187a343ad2 tools/python/xen/xend/server/DevController.py --- a/tools/python/xen/xend/server/DevController.py Fri Feb 20 17:02:36 2009 +0000 +++ b/tools/python/xen/xend/server/DevController.py Wed Feb 25 16:16:07 2009 +0100 @@ -235,8 +235,8 @@ xstransact.Remove(backpath) xstransact.Remove(frontpath) - # xstransact.Remove(self.devicePath()) ?? Below is the same ? - self.vm._removeVm("device/%s/%d" % (self.deviceClass, dev)) + # xstransact.Remove(self.devicePath()) ?? Below is the same ? + self.vm._removeVm("device/%s/%d" % (self.deviceClass, dev)) def configurations(self, transaction = None): return map(lambda x: self.configuration(x, transaction), self.deviceIDs(transaction))