2012-03-05 21:59:08 +01:00
|
|
|
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/<dom-uuid>
|
|
|
|
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.
|
2012-09-17 17:49:23 +02:00
|
|
|
Index: xen-4.2.0-testing/tools/python/xen/xend/XendConfig.py
|
2012-03-05 21:59:08 +01:00
|
|
|
===================================================================
|
2012-09-17 17:49:23 +02:00
|
|
|
--- xen-4.2.0-testing.orig/tools/python/xen/xend/XendConfig.py
|
|
|
|
+++ xen-4.2.0-testing/tools/python/xen/xend/XendConfig.py
|
|
|
|
@@ -1126,6 +1126,10 @@ class XendConfig(dict):
|
2012-03-05 21:59:08 +01:00
|
|
|
else:
|
|
|
|
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
|
|
|
|
if typ == dict:
|
|
|
|
s = self[name].items()
|
|
|
|
elif typ == list:
|