On Wed, Jul 18, 2007 at 09:11:42AM +0900, Atsushi SAKAI wrote:
Hi, Daniel
uint16(weight and cap) is copyied in src/virsh.c
so It cannot rewrite on src/xen_internal.c.
xenHypervisorSetSchedulerParameters() do get the int values
in the case XEN_SCHEDULER_CREDIT :
op_dom.u.getschedinfo.u.credit.weight = params[i].value.ui;
and
op_dom.u.getschedinfo.u.credit.cap = params[i].value.ui;
the ui field is an unsigned long. the test against the value
1 to USHRT_MAX can be done there and the case where one have
a negative value at the virsh level would correspond to an extremely
large integer in xenHypervisorSetSchedulerParameters() after the
unsigned cast.
See the enclosed patch, please check,
thanks,
Daniel
--
Red Hat Virtualization group
http://redhat.com/virtualization/
Daniel Veillard | virtualization library
http://libvirt.org/
veillard(a)redhat.com | libxml GNOME XML XSLT toolkit
http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine
http://rpmfind.net/