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 bug with managed domains not h

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Fix bug with managed domains not having their state updated.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 09 Nov 2006 18:40:15 +0000
Delivery-date: Thu, 09 Nov 2006 10:40:22 -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 a14732833603312b144062ea55aa929626190fc2
# Parent  023aa2926e7971eeb2fe208f987d2f2a20e824f0
[XEND] Fix bug with managed domains not having their state updated.

Also added some protection against corrupted sxp configuration files.

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

diff -r 023aa2926e79 -r a14732833603 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Thu Nov 09 12:38:12 2006 +0000
+++ b/tools/python/xen/xend/XendDomain.py       Thu Nov 09 13:16:55 2006 +0000
@@ -167,10 +167,11 @@ class XendDomain:
 
             # add all managed domains as dormant domains.
             for dom in managed:
-                dom_uuid = dom.get('uuid', uuid.createString())
-                dom['uuid'] = dom_uuid
+                dom_uuid = dom.get('uuid')
+                if not dom_uuid:
+                    continue
+                
                 dom_name = dom.get('name', 'Domain-%s' % dom_uuid)
-                
                 try:
                     running_dom = self.domain_lookup_nr(dom_name)
                     if not running_dom:
@@ -304,6 +305,11 @@ class XendDomain:
             try:
                 cfg_file = self._managed_config_path(dom_uuid)
                 cfg = XendConfig(filename = cfg_file)
+                if cfg.get('uuid') != dom_uuid:
+                    # something is wrong with the SXP
+                    log.error("UUID mismatch in stored configuration: %s" %
+                              cfg_file)
+                    continue
                 doms.append(cfg)
             except Exception:
                 log.exception('Unable to open or parse config.sxp: %s' % \
@@ -387,7 +393,7 @@ class XendDomain:
 
 
     def _add_domain(self, info):
-        """Add the given domain entry to this instance's internal cache.
+        """Add a domain to the list of running domains
         
         @requires: Expects to be protected by the domains_lock.
         @param info: XendDomainInfo of a domain to be added.
@@ -397,7 +403,7 @@ class XendDomain:
         self.domains[info.getDomid()] = info
 
     def _remove_domain(self, info, domid = None):
-        """Remove the given domain from this instance's internal cache.
+        """Remove the domain from the list of running domains
         
         @requires: Expects to be protected by the domains_lock.
         @param info: XendDomainInfo of a domain to be removed.
@@ -849,7 +855,7 @@ class XendDomain:
                 raise XendError("Domain is already running")
             
             dominfo.start(is_managed = True)
-
+            self._add_domain(dominfo)
         finally:
             self.domains_lock.release()
         
diff -r 023aa2926e79 -r a14732833603 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Thu Nov 09 12:38:12 2006 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Thu Nov 09 13:16:55 2006 +0000
@@ -1667,7 +1667,12 @@ class XendDomainInfo:
     # ----------------------------------------------------------------
 
     def get_uuid(self):
-        return self.info['uuid']
+        dom_uuid = self.info.get('uuid')
+        if not dom_uuid: # if it doesn't exist, make one up
+            dom_uuid = uuid.createString()
+            self.info['uuid'] = dom_uuid
+        return dom_uuid
+    
     def get_memory_static_max(self):
         return self.info['maxmem']
     def get_memory_static_min(self):

_______________________________________________
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 bug with managed domains not having their state updated., Xen patchbot-unstable <=