ia64/xen-unstable

changeset 16832:6f3fb3f86b68

xend: On block-attach, remove device information when VmError occurs.

I tested xm block-attach command with a wrong
parameter(file:). Naturally a command error occurred. Then I retested
xm block-attach command with a correct parameter(phy:). But a command
error occurred again. The second command error occurred because Xend
did not remove device information from self.info when the first
command error occurred.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jan 22 09:51:49 2008 +0000 (2008-01-22)
parents 2af5fb3e34e5
children 491c28320794
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Tue Jan 22 09:50:06 2008 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Jan 22 09:51:49 2008 +0000
     1.3 @@ -535,6 +535,11 @@ class XendDomainInfo:
     1.4                      self._createDevice(dev_type, dev_config_dict)
     1.5                  self._waitForDevice(dev_type, devid)
     1.6              except VmError, ex:
     1.7 +                del self.info['devices'][dev_uuid]
     1.8 +                if dev_type == 'tap':
     1.9 +                    self.info['vbd_refs'].remove(dev_uuid)
    1.10 +                else:
    1.11 +                    self.info['%s_refs' % dev_type].remove(dev_uuid)
    1.12                  raise ex
    1.13          else:
    1.14              devid = None