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] Fix check for whether domain is ru

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Fix check for whether domain is running.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 02 Nov 2006 22:08:49 +0000
Delivery-date: Thu, 02 Nov 2006 21:39:56 -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 c21f4949a746812ce83414baa729d31bb5705062
# Parent  029e04982e9439ad651f95eb97b306a52e726ff7
[XEND] Fix check for whether domain is running.

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

diff -r 029e04982e94 -r c21f4949a746 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Fri Oct 06 16:30:35 2006 +0100
+++ b/tools/python/xen/xend/XendAPI.py  Fri Oct 06 16:40:39 2006 +0100
@@ -953,7 +953,7 @@ class XendAPI:
             return xen_api_error(XEND_ERROR_VIF_INVALID)
         cfg = vm.get_dev_xenapi_config('vbd', vbd_ref)
         if not cfg:
-            return xen_api_error(XEND_ERROR_UNKNOWN)
+            return xen_api_error(XEND_ERROR_VIF_INVALID)
         return xen_api_success(cfg)
     
     # class methods
@@ -968,7 +968,6 @@ class XendAPI:
                 return xen_api_error(XEND_ERROR_TODO)
         else:
             return xen_api_error(XEND_ERROR_DOMAIN_INVALID)
-
 
     # attributes (rw)
     def vbd_get_vm(self, session, vbd_ref):
@@ -1014,7 +1013,7 @@ class XendAPI:
             return xen_api_error(XEND_ERROR_VIF_INVALID)
         cfg = vm.get_dev_xenapi_config('vif', vif_ref)
         if not cfg:
-            return xen_api_error(XEND_ERROR_UNKNOWN)
+            return xen_api_error(XEND_ERROR_VIF_INVALID)
         valid_vif_keys = self.VIF_attr_ro + self.VIF_attr_rw + \
                          self.Base_attr_ro + self.Base_attr_rw
         for k in cfg.keys():
diff -r 029e04982e94 -r c21f4949a746 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Oct 06 16:30:35 2006 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Oct 06 16:40:39 2006 +0100
@@ -1713,7 +1713,7 @@ class XendDomainInfo:
     def get_dev_config_by_uuid(self, dev_class, dev_uuid):
         """ Get's a device configuration either from XendConfig or
         from the DevController."""
-        if self.get_power_state() not in ('Halted',):
+        if self.get_power_state() in (XEN_API_VM_POWER_STATE_HALTED,):
             dev = self.info['device'].get(dev_uuid)
             if dev:
                 return dev[1].copy()
@@ -1722,9 +1722,11 @@ class XendDomainInfo:
             controller = self.getDeviceController(dev_class)
             if not controller:
                 return None
+            
             all_configs = controller.getAllDeviceConfigurations()
             if not all_configs:
                 return None
+
             for _devid, _devcfg in all_configs.items():
                 if _devcfg.get('uuid') == dev_uuid:
                     devcfg = _devcfg.copy()

_______________________________________________
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] Fix check for whether domain is running., Xen patchbot-unstable <=