WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] xm block-detach fails for blktap devices (temporary solution

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] xm block-detach fails for blktap devices (temporary solution)
From: Andres Lagar Cavilla <andreslc@xxxxxxxxxxxxxx>
Date: Fri, 18 Aug 2006 15:48:39 -0400
Delivery-date: Fri, 18 Aug 2006 12:48:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929)
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   2006-08-17 17:17:46.000000000 -0400
+++ XendDomainInfo.py.new       2006-08-18 15:42:18.000000000 -0400
@@ -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
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] xm block-detach fails for blktap devices (temporary solution), Andres Lagar Cavilla <=