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

[Xen-devel] [PATCH][Xend] Fix disappearance of managed hvm domains on xend restart



With c/s 14341, I noticed that managed HVM domains are not displayed by
'xm list' after restarting xend.  When restarting xend and consequently
reading the managed domain config files, parsing fails on HVM domains
due to empty config items in the sexpr.  So for example 'xm new
hvm_config_file' results in the following snippet from
/var/lib/xend/domains/<uuid>/config.sxp:

   (platform
        ((fda )
            (vncunused 1)
            (fdb )
 
When xend is restarted and the various config files read/parsed, it
cannot cope with the config items containing no values (e.g. fda or fdb
above).

This patch prevents writing the config items when their values are
empty.  Perhaps there is a more appropriate fix but this patch corrects
the described behavior.

Regards,
Jim
# HG changeset patch
# User Jim Fehlig <jfehlig@xxxxxxxxxx>
# Date 1173831191 21600
# Node ID 7fce1e4ffe33a7d02d750a55f5527232ab6dbada
# Parent  127bee61972bfaf20150984d4860ba1b9359e8b3
Managed HVM guests are not displayed by 'xm list' after restarting xend.
This patch prevents writing empty configuration items to the domain's
sexpr configuration file.  Without the empty items, the sexpr is
parsed properly when xend is started.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>

diff -r 127bee61972b -r 7fce1e4ffe33 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Tue Mar 13 14:56:03 2007 +0000
+++ b/tools/python/xen/xend/XendConfig.py       Tue Mar 13 18:13:11 2007 -0600
@@ -686,7 +686,7 @@ class XendConfig(dict):
             
             for key in XENAPI_PLATFORM_CFG:
                 val = sxp.child_value(image_sxp, key, None)
-                if val is not None:
+                if val is not None and val != '':
                     self['platform'][key] = val
             
             notes = sxp.children(image_sxp, 'notes')
@@ -1310,7 +1310,7 @@ class XendConfig(dict):
 
         for key in XENAPI_PLATFORM_CFG:
             val = sxp.child_value(image_sxp, key, None)
-            if val is not None:
+            if val is not None and val != '':
                 self['platform'][key] = val
 
         notes = sxp.children(image_sxp, 'notes')
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

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