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

[Xen-changelog] [xen-unstable] Values of cpu_weight and cpu_cap are lost

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Values of cpu_weight and cpu_cap are lost after xend restart
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 18 Aug 2010 07:00:59 -0700
Delivery-date: Wed, 18 Aug 2010 07:08:52 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Lutz Dube Lutz.Dube@xxxxxxxxxxxxxx
# Date 1281975250 -3600
# Node ID 4fc66044477dd806f9ef4202b47518a0f5e134d5
# Parent  cd5b4135fe03da4f2184d2a43659138d22163ed9
Values of cpu_weight and cpu_cap are lost after xend restart

For managed domains in state 'halted' I always get default values
for cpu_cap / cpu_weight after xend restart.
This is because the names of parameters differ between a SXP file to
create a VM (here the parameter names are cpu_cap / cpu_weight) and
a SXP file of a managed VM (here vcpus_params (cap 0) (weight 0)).
But XendConfig.py reads only cpu_cap / cpu_weight and if not found,
default values are used.
?
The patch reads first vcpus_params (cap, weight), if not found then cpu_cap,
cpu_weight and if both parameters are missing it uses the default values.
?
Signed-off-by: Lutz Dube Lutz.Dube@xxxxxxxxxxxxxx
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
committer: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendConfig.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff -r cd5b4135fe03 -r 4fc66044477d tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Mon Aug 16 17:11:30 2010 +0100
+++ b/tools/python/xen/xend/XendConfig.py       Mon Aug 16 17:14:10 2010 +0100
@@ -686,10 +686,12 @@ class XendConfig(dict):
         # Convert scheduling parameters to vcpus_params
         if 'vcpus_params' not in cfg:
             cfg['vcpus_params'] = {}
-        cfg["vcpus_params"]["weight"] = \
-            int(sxp.child_value(sxp_cfg, "cpu_weight", 256))
-        cfg["vcpus_params"]["cap"] = \
-            int(sxp.child_value(sxp_cfg, "cpu_cap", 0))
+        if not cfg["vcpus_params"].has_key("weight"):
+            cfg["vcpus_params"]["weight"] = \
+                int(sxp.child_value(sxp_cfg, "cpu_weight", 256))
+        if not cfg["vcpus_params"].has_key("cap"):
+            cfg["vcpus_params"]["cap"] = \
+                int(sxp.child_value(sxp_cfg, "cpu_cap", 0))
 
         # Only extract options we know about.
         extract_keys = LEGACY_UNSUPPORTED_BY_XENAPI_CFG + \

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Values of cpu_weight and cpu_cap are lost after xend restart, Xen patchbot-unstable <=