mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
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>
This commit is contained in:
1 parent
92765dcf80
commit
bf4b59a4c7
1 file changed
+5
@@ -535,6 +535,11 @@ class XendDomainInfo:
|
||||
self._createDevice(dev_type, dev_config_dict)
|
||||
self._waitForDevice(dev_type, devid)
|
||||
except VmError, ex:
|
||||
del self.info['devices'][dev_uuid]
|
||||
if dev_type == 'tap':
|
||||
self.info['vbd_refs'].remove(dev_uuid)
|
||||
else:
|
||||
self.info['%s_refs' % dev_type].remove(dev_uuid)
|
||||
raise ex
|
||||
else:
|
||||
devid = None
|
||||
|
||||