ia64/xen-unstable

changeset 18844:8dbf23c89cc6

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>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Nov 28 13:05:58 2008 +0000 (2008-11-28)
parents abada55aec43
children c820bf73a914
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Fri Nov 28 13:04:30 2008 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Fri Nov 28 13:05:58 2008 +0000
     1.3 @@ -1990,13 +1990,21 @@ class XendDomainInfo:
     1.4              for devclass in XendDevices.valid_devices():
     1.5                  for dev in t.list(devclass):
     1.6                      try:
     1.7 +                        true_devclass = devclass
     1.8 +                        if devclass == 'vbd':
     1.9 +                            # In the case of "vbd", the true device class
    1.10 +                            # may possibly be "tap". Just in case, verify
    1.11 +                            # device class.
    1.12 +                            devid = dev.split('/')[-1]
    1.13 +                            true_devclass = self.getBlockDeviceClass(devid)
    1.14                          log.debug("Removing %s", dev);
    1.15 -                        self.destroyDevice(devclass, dev, False);
    1.16 +                        self.destroyDevice(true_devclass, dev, False);
    1.17                      except:
    1.18                          # Log and swallow any exceptions in removal --
    1.19                          # there's nothing more we can do.
    1.20                          log.exception("Device release failed: %s; %s; %s",
    1.21 -                                      self.info['name_label'], devclass, dev)
    1.22 +                                      self.info['name_label'],
    1.23 +                                      true_devclass, dev)
    1.24          finally:
    1.25              t.abort()
    1.26