From: Ian Jackson Subject: Re: [PATCH] tools/xend: Only add cpuid and cpuid_check to sexpr once Date: Tue, 19 Feb 2013 18:21:58 +0000 Message-ID: <20771.49862.534182.856929@mariner.uk.xensource.com> References: <0f9c7503650fa1b1103b.1360862057@probook.site> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <0f9c7503650fa1b1103b.1360862057@probook.site> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Olaf Hering writes ("[Xen-devel] [PATCH] tools/xend: Only add cpuid and cpuid_check to sexpr once"): > tools/xend: Only add cpuid and cpuid_check to sexpr once > > When converting a XendConfig object to sexpr, cpuid and cpuid_check > were being emitted twice in the resulting sexpr. The first conversion > writes incorrect sexpr, causing parsing of the sexpr to fail when xend > is restarted and domain sexpr files in /var/lib/xend/domains/ > are read and parsed. > > This patch skips the first conversion, and uses only the custom > cpuid{_check} conversion methods called later. It is not pretty, but > is the least invasive fix in this complex code. We do intend to fix bugs in xend, but I'm worried that this change might break something. I don't know the code at all so forgive me if I'm asking stupid questions, but why does the first conversion emit an invalid sexpr ? > for name, typ in XENAPI_CFG_TYPES.items(): > if name in self and self[name] not in (None, []): > + # Skip cpuid and cpuid_check. Custom conversion > + # methods for these are called below. > + if name in ("cpuid", "cpuid_check"): > + continue I do agree that this looks plausible because as your comment says, the cpuid and cpuid_check values are converted explicitly later. Thanks, Ian.