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

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

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Values of cpu_weight and cpu_cap are lost after xend restart
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
Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=ts.fujitsu.com; i=lutz.dube@xxxxxxxxxxxxxx; q=dns/txt; s=s1536b; t=1281431187; x=1312967187; h=from:to:date:subject:message-id:mime-version; z=From:=20"Dube,=20Lutz"=20<lutz.dube@xxxxxxxxxxxxxx>|To: =20"xen-devel@xxxxxxxxxxxxxxxxxxx"=20<xen-devel@xxxxxxxxx source.com>|Date:=20Tue,=2010=20Aug=202010=2011:06:27=20+ 0200|Subject:=20[PATCH]=20Values=20of=20cpu_weight=20and =20cpu_cap=20are=20lost=20after=20xend=20restart |Message-ID:=20<3958B14F314B884890EEE2F4CCDAB6A601122BF3F D52@xxxxxxxxxxxxxxxx>|MIME-Version:=201.0; bh=U/PA8wqW219l2fqfuKLqU21FEKxNxptGVfB8nx9FkB4=; b=F8ijdE3zz1NgKyVnFXDLgYIe1U4Fc87eIri3JKi/CmQuIbgSxDmaITX4 GZp6YchJ3qOE1VxJMez2k11aT5V0WwQvYBNxFg+fLp5tPQ6maEGrt7vAe Ln0M374goagDfHPbFY5DnA4V45AihuuTN46m0ICPbV/sb9BctHUZ3E8Y0 qf/w3MCy9GG+cp2E2tG7HA58MNvgQkcW8ic1RkClQ4azYueM6lhvpB4Uj Y5JmYq+FiQH7kHBIo6RpiMIQhO1Rq;
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;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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