From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andres Lagar Cavilla Subject: xm block-detach fails for blktap devices (temporary solution) Date: Fri, 18 Aug 2006 15:48:39 -0400 Message-ID: <44E61997.7040206@cs.toronto.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040407000203080807070206" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------040407000203080807070206 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------040407000203080807070206 Content-Type: text/x-patch; name="XendDomainInfo.py.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="XendDomainInfo.py.patch" --- 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): --------------040407000203080807070206 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------040407000203080807070206--