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-devel

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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH][Xend] Fix disappearance of managed hvm domains on xend restart
From: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date: Tue, 13 Mar 2007 18:24:53 -0600
Delivery-date: Tue, 13 Mar 2007 17:30:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.8 (X11/20060911)
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
<Prev in Thread] Current Thread [Next in Thread>