[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] When creating a VBD, save the devid in the device info structure. If creation



# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1174391053 0
# Node ID dace880e871a22883f61a3fdaeafae7fdd51ba58
# Parent  8b527e3d27d6963dc426b0168f0343811e225ca9
When creating a VBD, save the devid in the device info structure.  If creation
fails, remove the device config entry.

Signed-off-by: Tom Wilkie <tom.wilkie@xxxxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff -r 8b527e3d27d6 -r dace880e871a tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Tue Mar 20 11:34:14 2007 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Tue Mar 20 11:44:13 2007 +0000
@@ -2301,12 +2301,21 @@ class XendDomainInfo:
             dev_control = None
             
             if vdi_image_path.startswith('tap'):
-                dev_control =  self.getDeviceController('tap')
+                dev_control = self.getDeviceController('tap')
             else:
                 dev_control = self.getDeviceController('vbd')
-                
-            config['devid'] = dev_control.createDevice(config)
-
+
+            try:
+                devid = dev_control.createDevice(config)
+                dev_control.waitForDevice(devid)
+                self.info.device_update(dev_uuid,
+                                        cfg_xenapi = {'devid': devid})
+            except Exception, exn:
+                log.exception(exn)
+                del self.info['devices'][dev_uuid]
+                self.info['vbd_refs'].remove(dev_uuid)
+                raise
+            
         return dev_uuid
 
     def create_phantom_vbd_with_vdi(self, xenapi_vbd, vdi_image_path):

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.