Skip to contentSkip to conversation

xend: Fix handling of pci creation failure in device_create()

PATCH New Yosuke Iwamatsu 1 participant 1 message Aug 4, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xend: Fix handling of pci creation failure in device_create()

Fix handling of pci creation failure in device_create(). Since xen-api instances of pci devices are stored in XendAPIStore, we need to deregister them when device creation failed.

Regards,
-----------------------
Yosuke Iwamatsu
NEC Corporation

xend: Fix handling of pci creation failure in device_create().

tools/python/xen/xend/XendDomainInfo.py +4 -1
diff -r 8951c3b84e2a tools/python/xen/xend/XendDomainInfo.py
@@ -638,7 +638,10 @@ class XendDomainInfo:
                 self._waitForDevice(dev_type, devid)
             except VmError, ex:
                 del self.info['devices'][dev_uuid]
-                if dev_type == 'tap':
+                if dev_type == 'pci':
+                    for dev in dev_config_dict['devs']:
+                        XendAPIStore.deregister(dev['uuid'], 'DPCI')
+                elif dev_type == 'tap':
                     self.info['vbd_refs'].remove(dev_uuid)
                 else:
                     self.info['%s_refs' % dev_type].remove(dev_uuid)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel