[Libvir] [PATCH] virsh Range check in Credit Scheduler

Saori Fukuta fukuta.saori at jp.fujitsu.com
Fri Jul 20 10:10:12 UTC 2007


On Fri, 20 Jul 2007 05:00:41 -0400 Daniel Veillard wrote:
> On Fri, Jul 20, 2007 at 05:17:34PM +0900, Saori Fukuta wrote:
> > The schedinfo command said strange message.
> > # virsh schedinfo 25 --weight 0
> > libvir: Xen error : invalid argument in xenHypervisorSetSchedulerParameters: 
> > Credit scheduler weight parameter (%d) is out of range (1-65535)
> >                                   ^^^^here
> > # virsh schedinfo 25 --cap -1
> > libvir: Xen error : invalid argument in xenHypervisorSetSchedulerParameters: 
> > Credit scheduler cap parameter (%d) is out of range (0-65535)
> >                                ^^^^here
> > 
> 
>   That would be nicer, we have the information and don't pass it to the user.
> It may not be a big gain when used purely from virsh but for future automatic
> tuning tools it may be interesting to get the value reported back. An
> snprintf to a local buffer to generate the string may be sufficient. I 
> didn't applied remove_perD.patch for this reason, if you send another
> patch I will fix this or I could just do it.

OK, I understand the purpose of passing it.
I simply added snprintf. How about this ?

# ./virsh schedinfo 25 --weight 0
libvir: Xen error : invalid argument in xenHypervisorSetSchedulerParameters: 
Credit scheduler weight parameter (0) is out of range (1-65535)

# ./virsh schedinfo 25 --cap  -1
libvir: Xen error : invalid argument in xenHypervisorSetSchedulerParameters: 
Credit scheduler cap parameter (-1) is out of range (0-65535)

> > And I found some wrong code when I was checking about error message.
> > So I fix them, but if I have a misunderstanding of them, please tell me. :-)
> >  o I guess 10th argument of __virRaiseError should be specified the number
> >    of the line. But the value, for example which is number of heypercall, 
> >    is sometimes specified.
> 
>   Well not really it's just  str1 - str3/int1 - int2 are just extra 
> informations. This is intended to populate the virError fields to be used
> for more precise error handling than the default one. 
> 
>   There is still some point of the patch which make sense, for example 
> adding value at the end of the argument list in virXenError(), I will apply
> some of those but not remove the tenth value.

Thank you for explaining !

Saori.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_snprintf.patch
Type: application/octet-stream
Size: 2169 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070720/8bd61fac/attachment-0001.obj>


More information about the libvir-list mailing list