From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Fehlig Subject: [PATCH][Xend] Fix disappearance of managed hvm domains on xend restart Date: Tue, 13 Mar 2007 18:24:53 -0600 Message-ID: <45F740D5.8090708@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000908000407070902050102" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------000908000407070902050102 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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//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 --------------000908000407070902050102 Content-Type: text/x-patch; name="xend-managed-hvm.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xend-managed-hvm.patch" # HG changeset patch # User Jim Fehlig # 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 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') --------------000908000407070902050102 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------000908000407070902050102--