* [PATCH] Values of cpu_weight and cpu_cap are lost after xend restart
@ 2010-08-10 9:06 Dube, Lutz
2010-08-16 16:35 ` Stefano Stabellini
2010-08-27 12:53 ` Olaf Hering
0 siblings, 2 replies; 5+ messages in thread
From: Dube, Lutz @ 2010-08-10 9:06 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 2293 bytes --]
# 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@ts.fujitsu.com
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@ts.fujitsu.com
Internet: http://ts.fujitsu.com<http://ts.fujitsu.com/>
Firmenangaben: http://de.ts.fujitsu.com/imprint.html
[-- Attachment #1.2: Type: text/html, Size: 5076 bytes --]
[-- Attachment #2: patch-cap_weight --]
[-- Type: application/octet-stream, Size: 1850 bytes --]
# 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@ts.fujitsu.com
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 + \
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Values of cpu_weight and cpu_cap are lost after xend restart
2010-08-10 9:06 [PATCH] Values of cpu_weight and cpu_cap are lost after xend restart Dube, Lutz
@ 2010-08-16 16:35 ` Stefano Stabellini
2010-08-16 19:15 ` Pasi Kärkkäinen
2010-08-27 12:53 ` Olaf Hering
1 sibling, 1 reply; 5+ messages in thread
From: Stefano Stabellini @ 2010-08-16 16:35 UTC (permalink / raw)
To: Dube, Lutz; +Cc: xen-devel
[-- Attachment #1: Type: text/plain, Size: 932 bytes --]
On Tue, 10 Aug 2010, Dube, Lutz wrote:
> # 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@ts.fujitsu.com
>
applied, thanks
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Values of cpu_weight and cpu_cap are lost after xend restart
2010-08-16 16:35 ` Stefano Stabellini
@ 2010-08-16 19:15 ` Pasi Kärkkäinen
0 siblings, 0 replies; 5+ messages in thread
From: Pasi Kärkkäinen @ 2010-08-16 19:15 UTC (permalink / raw)
To: Stefano Stabellini; +Cc: Dube, Lutz, xen-devel
On Mon, Aug 16, 2010 at 05:35:24PM +0100, Stefano Stabellini wrote:
> On Tue, 10 Aug 2010, Dube, Lutz wrote:
> > # 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@ts.fujitsu.com
> >
>
> applied, thanks
>
Is this needed for xen-4.0-testing.hg aswell?
-- Pasi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Values of cpu_weight and cpu_cap are lost after xend restart
2010-08-10 9:06 [PATCH] Values of cpu_weight and cpu_cap are lost after xend restart Dube, Lutz
2010-08-16 16:35 ` Stefano Stabellini
@ 2010-08-27 12:53 ` Olaf Hering
2010-08-30 6:41 ` Dube, Lutz
1 sibling, 1 reply; 5+ messages in thread
From: Olaf Hering @ 2010-08-27 12:53 UTC (permalink / raw)
To: Dube, Lutz; +Cc: xen-devel
On Tue, Aug 10, Dube, Lutz wrote:
> # 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.
Lutz,
does xen-unstable actually work for you after this change is applied?
xm start <guest> fails for me on SLES11, as first reported here:
http://lists.xensource.com/archives/html/xen-devel/2010-08/msg01461.html
My python skills are not good enough to fix it, and this change looks
like the only one between rev 21976:22019 that touches self.getWeight()
related code in XendDomainInfo.py
[2010-08-27 14:36:38 4654] ERROR (XendDomainInfo:488) VM start failed
Traceback (most recent call last):
File "/usr/lib64/python2.6/site-packages/xen/xend/XendDomainInfo.py", line 473, in start
XendTask.log_progress(0, 30, self._constructDomain)
File "/usr/lib64/python2.6/site-packages/xen/xend/XendTask.py", line 209, in log_progress
retval = func(*args, **kwds)
File "/usr/lib64/python2.6/site-packages/xen/xend/XendDomainInfo.py", line 2618, in _constructDomain
assert type(weight) == int
AssertionError
Olaf
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] Values of cpu_weight and cpu_cap are lost after xend restart
2010-08-27 12:53 ` Olaf Hering
@ 2010-08-30 6:41 ` Dube, Lutz
0 siblings, 0 replies; 5+ messages in thread
From: Dube, Lutz @ 2010-08-30 6:41 UTC (permalink / raw)
To: Olaf Hering; +Cc: xen-devel
[-- Attachment #1: Type: text/plain, Size: 2589 bytes --]
Hi Olaf,
yes you are right, it's my mistake. The patch is not complete.
After reading the managed SXP file the values of weight and cap are of
type string not of type int.
The original code (before my patch) overwrites these values with the given weight/cap or
the default values. Both values have type int.
My patch leaves the values taken from managed SXP unchanged, if already set,
so they have type string not int!
I have to convert the values of weight/cap to int. I will extend the patch.
Thanks
Lutz
-----Original Message-----
From: Olaf Hering [mailto:olaf@aepfle.de]
Sent: Friday, August 27, 2010 2:54 PM
To: Dube, Lutz
Cc: xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH] Values of cpu_weight and cpu_cap are lost after xend restart
On Tue, Aug 10, Dube, Lutz wrote:
> # 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.
Lutz,
does xen-unstable actually work for you after this change is applied?
xm start <guest> fails for me on SLES11, as first reported here:
http://lists.xensource.com/archives/html/xen-devel/2010-08/msg01461.html
My python skills are not good enough to fix it, and this change looks
like the only one between rev 21976:22019 that touches self.getWeight()
related code in XendDomainInfo.py
[2010-08-27 14:36:38 4654] ERROR (XendDomainInfo:488) VM start failed
Traceback (most recent call last):
File "/usr/lib64/python2.6/site-packages/xen/xend/XendDomainInfo.py", line 473, in start
XendTask.log_progress(0, 30, self._constructDomain)
File "/usr/lib64/python2.6/site-packages/xen/xend/XendTask.py", line 209, in log_progress
retval = func(*args, **kwds)
File "/usr/lib64/python2.6/site-packages/xen/xend/XendDomainInfo.py", line 2618, in _constructDomain
assert type(weight) == int
AssertionError
Olaf
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-08-30 6:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-10 9:06 [PATCH] Values of cpu_weight and cpu_cap are lost after xend restart Dube, Lutz
2010-08-16 16:35 ` Stefano Stabellini
2010-08-16 19:15 ` Pasi Kärkkäinen
2010-08-27 12:53 ` Olaf Hering
2010-08-30 6:41 ` Dube, Lutz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.