diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-07-06 14:41:05 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-07-06 14:41:05 +0100 |
commit | fefb7c8d3bbb4986ea9f43b2b7685245f5fe18a5 (patch) | |
tree | 0bcbf3bc30aabf126b5ad027f1914cfb3c7bccb3 /tools | |
parent | 4c9048d9dc129dc6febc4964c936be021dbc2a97 (diff) | |
download | xen-fefb7c8d3bbb4986ea9f43b2b7685245f5fe18a5.tar.gz xen-fefb7c8d3bbb4986ea9f43b2b7685245f5fe18a5.tar.bz2 xen-fefb7c8d3bbb4986ea9f43b2b7685245f5fe18a5.zip |
xend: Fix xm block/network-attach command for inactive managed domain
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/python/xen/xend/XendDomainInfo.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 2f9eb592f5..a142d07301 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -502,9 +502,18 @@ class XendDomainInfo: dev_uuid = self.info.device_add(dev_type, cfg_sxp = dev_config) dev_config_dict = self.info['devices'][dev_uuid][1] log.debug("XendDomainInfo.device_create: %s" % scrub_password(dev_config_dict)) - dev_config_dict['devid'] = devid = \ - self._createDevice(dev_type, dev_config_dict) - self._waitForDevice(dev_type, devid) + + if self.domid is not None: + try: + dev_config_dict['devid'] = devid = \ + self._createDevice(dev_type, dev_config_dict) + self._waitForDevice(dev_type, devid) + except VmError, ex: + raise ex + else: + devid = None + + xen.xend.XendDomain.instance().managed_config_save(self) return self.getDeviceController(dev_type).sxpr(devid) def device_configure(self, dev_sxp, devid = None): |