WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [XEND] Keep track of attached vbds and vi

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Keep track of attached vbds and vifs for XenAPI
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 02 Nov 2006 22:08:45 +0000
Delivery-date: Thu, 02 Nov 2006 21:41:47 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alastair Tse <atse@xxxxxxxxxxxxx>
# Node ID dd044380b44d148681b22350fe1b0fb1f0554d07
# Parent  18506db37dc24e56237740869e5a496c82b2b272
[XEND] Keep track of attached vbds and vifs for XenAPI

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendAPI.py    |    4 +++-
 tools/python/xen/xend/XendConfig.py |    9 ++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff -r 18506db37dc2 -r dd044380b44d tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Fri Oct 06 12:02:29 2006 +0100
+++ b/tools/python/xen/xend/XendAPI.py  Fri Oct 06 12:30:46 2006 +0100
@@ -833,7 +833,9 @@ class XendAPI:
     def vm_get_by_label(self, session, label):
         xendom = XendDomain.instance()
         dom = xendom.domain_lookup_nr(label)
-        return xen_api_success(dom.get_uuid())
+        if dom:
+            return xen_api_success(dom.get_uuid())
+        return xen_api_error(XEND_ERROR_VM_INVALID)
     def vm_create(self, session, vm_struct):
         xendom = XendDomain.instance()
         domuuid = xendom.create_domain(vm_struct)
diff -r 18506db37dc2 -r dd044380b44d tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Fri Oct 06 12:02:29 2006 +0100
+++ b/tools/python/xen/xend/XendConfig.py       Fri Oct 06 12:30:46 2006 +0100
@@ -726,7 +726,10 @@ class XendConfig(dict):
             raise XendConfigError("XendConfig: device_add requires some "
                                   "config.")
 
-        log.debug("XendConfig.device_add: %s" % str(cfg_sxp))
+        if cfg_sxp:
+            log.debug("XendConfig.device_add: %s" % str(cfg_sxp))
+        if cfg_xenapi:
+            log.debug("XendConfig.device_add: %s" % str(cfg_xenapi))
 
         if cfg_sxp:
             config = sxp.child0(cfg_sxp)
@@ -743,6 +746,8 @@ class XendConfig(dict):
             dev_uuid = dev_info.get('uuid', uuid.createString())
             dev_info['uuid'] = dev_uuid
             self['device'][dev_uuid] = (dev_type, dev_info)
+            if dev_type in ('vif', 'vbd'):
+                self['%s_refs' % dev_type].append(dev_uuid)
             return dev_uuid
 
         if cfg_xenapi:
@@ -761,6 +766,7 @@ class XendConfig(dict):
                 dev_uuid = cfg_xenapi.get('uuid', uuid.createString())
                 dev_info['uuid'] = dev_uuid
                 self['device'][dev_uuid] = (dev_type, dev_info)
+                self['vif_refs'].append(dev_uuid)
                 return dev_uuid
             
             elif dev_type == 'vbd':
@@ -774,6 +780,7 @@ class XendConfig(dict):
                 dev_uuid = cfg_xenapi.get('uuid', uuid.createString())
                 dev_info['uuid'] = dev_uuid
                 self['device'][dev_uuid] = (dev_type, dev_info)
+                self['vbd_refs'].append(dev_uuid)                
                 return dev_uuid
                 
                 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEND] Keep track of attached vbds and vifs for XenAPI, Xen patchbot-unstable <=