mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
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>
This commit is contained in:
1 parent
2fdd853ff5
commit
c4e83a1484
1 file changed
+10
-2
@@ -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()
|
||||
|
||||
|
||||