Skip to contentSkip to conversation

xm block-detach fails for blktap devices (temporary solution)

PATCH Andres Lagar Cavilla 1 participant 1 message Aug 18, 2006

lore
Share & tools
lore
#0 lore raw

Hi,
as per the subject line, I'm unable to block-detach blktap devices (on unstable).
Reason is, afaict, that xm_block_detach in python/xm/main.py passes 'vbd' as deviceClass, while blktap devices are added to the store with deviceClass = 'tap' The attached patch solves this problem in a rather rudimentary way.

Andres

XendDomainInfo.py.new renamed from XendDomainInfo.py +7 -1
@@ -1078,7 +1078,13 @@
     ## public:
 
     def destroyDevice(self, deviceClass, devid):
-        return self.getDeviceController(deviceClass).destroyDevice(devid)
+	try:
+	    return self.getDeviceController(deviceClass).destroyDevice(devid)
+	except VmError:
+	    if deviceClass == 'vbd':
+		return self.getDeviceController('tap').destroyDevice(devid)
+	    else:
+		raise
 
 
     def getDeviceSxprs(self, deviceClass):

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