mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
tools: fix cpu_weight/cap loss (22000:4fc66044477d)
Correction/Extension of changeset 22000:4fc66044477d "Values of cpu_weight and cpu_cap are lost after xend restart" Values of cpu_weight and cpu_cap taken from managed SXP file have to be converted from str to int. Signed-off-by: Lutz Dube <lutz.dube@ts.fujitsu.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
dca1b6e714
commit
eb37dccf5b
1 file changed
+5
@@ -689,9 +689,14 @@ class XendConfig(dict):
|
||||
if not cfg["vcpus_params"].has_key("weight"):
|
||||
cfg["vcpus_params"]["weight"] = \
|
||||
int(sxp.child_value(sxp_cfg, "cpu_weight", 256))
|
||||
else:
|
||||
cfg["vcpus_params"]["weight"] = int(cfg["vcpus_params"]["weight"])
|
||||
|
||||
if not cfg["vcpus_params"].has_key("cap"):
|
||||
cfg["vcpus_params"]["cap"] = \
|
||||
int(sxp.child_value(sxp_cfg, "cpu_cap", 0))
|
||||
else:
|
||||
cfg["vcpus_params"]["cap"] = int(cfg["vcpus_params"]["cap"])
|
||||
|
||||
# Only extract options we know about.
|
||||
extract_keys = LEGACY_UNSUPPORTED_BY_XENAPI_CFG + \
|
||||
|
||||