aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-11-28 13:05:58 +0000
committerKeir Fraser <keir.fraser@citrix.com>2008-11-28 13:05:58 +0000
commitc4e83a1484339a709081442f45e40bbc5aa98d0a (patch)
tree228e15bf075f9f2e423079a573a40872bd2848d4 /tools
parent2fdd853ff51eff7c29255ad1fe64783cf262c26c (diff)
downloadxen-c4e83a1484339a709081442f45e40bbc5aa98d0a.tar.gz
xen-c4e83a1484339a709081442f45e40bbc5aa98d0a.tar.bz2
xen-c4e83a1484339a709081442f45e40bbc5aa98d0a.zip
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 <kanno.masaki@jp.fujitsu.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/python/xen/xend/XendDomainInfo.py12
1 files changed, 10 insertions, 2 deletions
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()