[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] Values of cpu_weight and cpu_cap are lost after xend restart


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "Dube, Lutz" <lutz.dube@xxxxxxxxxxxxxx>
  • Date: Tue, 10 Aug 2010 11:06:27 +0200
  • Accept-language: de-DE, en-US
  • Acceptlanguage: de-DE, en-US
  • Delivery-date: Tue, 10 Aug 2010 02:09:04 -0700
  • Domainkey-signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:Received:From:To:Date: Subject:Thread-Topic:Thread-Index:Message-ID: Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:acceptlanguage:Content-Type: MIME-Version; b=H0W3cvmIJPruuhiW2Jmsqr64XchU/mPz6hhiiyoBzK8YOw2ydVFtiEDw 7AAGQTm/SeXenkSLq4/flm53PBvsCvMZCJcb4IjLxkTKLZsVX4hEXgTtL q/SHJOS3VN6ww428rHphvNoW67+en24xWNI+VjipVyMaX1/PVrsKm831j gGfn/KA2760EOVPRliJ/xI+ErOd3ttOLFj9m2YazzZoe9ftJ6FQ7hNHe4 Hu+rVxTT3B3hC78hx2KFqa/g9d03I;
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Acs4a1B4rS0YvqegSTOwjguNMQI+ow==
  • Thread-topic: [PATCH] Values of cpu_weight and cpu_cap are lost after xend restart

# HG changeset patch
# User Lutz.Dube
# Node ID ca2c8c262dbaa6b2521cec60af7cd688dabdf850
# Parent  8992134dcfd0b9e1e86f4111e68a8aa48bd33c3c
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
 
diff -r 8992134dcfd0 -r ca2c8c262dba tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Wed Aug 04 19:24:17 2010 +0100
+++ b/tools/python/xen/xend/XendConfig.py       Tue Aug 10 10:45:59 2010 +0200
@@ -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 + \
 
---
Kind regards
 
Lutz Dube
Softwareentwickler
TSP ES&S SWE OS7
 
FUJITSU TECHNOLOGY SOLUTIONS GMBH
Domagkstr. 28
D-80807 München
 
Telefon:        +49 (0)89 3222 2688
Telefax:        +49 (0)89 3222 329 2688
Email:          Lutz Dube@xxxxxxxxxxxxxx
 
Internet:        http://ts.fujitsu.com
 
 
 
 

Attachment: patch-cap_weight
Description: patch-cap_weight

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.