From: Keir Fraser Date: Fri, 28 Nov 2008 13:05:58 +0000 (+0000) Subject: xend: Fix device release for tap devices X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14040^2~15 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c4e83a1484339a709081442f45e40bbc5aa98d0a;p=xen.git xend: Fix device release for tap devices I saw an error message when I shut down a domain. The error message showed that release of device(vbd/51712) failed. But the device was tap, was not vbd. I think that a cause of the error message is because _releaseDevices() calls destroyDevice() by wrong device class. Signed-off-by: Masaki Kanno --- diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index bab9d3aef2..7478cb2885 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -1990,13 +1990,21 @@ class XendDomainInfo: for devclass in XendDevices.valid_devices(): for dev in t.list(devclass): try: + true_devclass = devclass + if devclass == 'vbd': + # In the case of "vbd", the true device class + # may possibly be "tap". Just in case, verify + # device class. + devid = dev.split('/')[-1] + true_devclass = self.getBlockDeviceClass(devid) log.debug("Removing %s", dev); - self.destroyDevice(devclass, dev, False); + self.destroyDevice(true_devclass, dev, False); except: # Log and swallow any exceptions in removal -- # there's nothing more we can do. log.exception("Device release failed: %s; %s; %s", - self.info['name_label'], devclass, dev) + self.info['name_label'], + true_devclass, dev) finally: t.abort()