Skip to contentSkip to conversation

Fix disappearance of managed hvm domains on xend restart

PATCH Applied Jim Fehlig 2 participants 2 messages Mar 14, 2007 – Mar 29, 2007

lore
Share & tools
lore

Jim Fehlig

author
#0 lore raw

PATCH 1/1 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 <[email protected]>
# 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.

tools/python/xen/xend/XendConfig.py +2 -2
diff -r 127bee61972b -r 7fce1e4ffe33 tools/python/xen/xend/XendConfig.py
@@ -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
[email protected]
http://lists.xensource.com/xen-devel

Applied
#1 lore raw
Quoted 12 lines · Jim Fehlig

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 )
Quoted 7 lines

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.

Applied, thank you, and sorry for the delay.

Ewan.