Re: [libvirt] [PATCH V2] virsh: forbid negative vcpu argument to vcpupin.

2014-05-29 Thread Eric Blake
On 05/29/2014 05:47 AM, Peter Krempa wrote: > Still not quite right ... vshCommandOptUInt currently wraps negative > numbers to their 2's complement and stores them in the uint. I recently tweaked virstring.c to provide virStrToLong_uip and friends for rejecting negative input when parsing unsign

Re: [libvirt] [PATCH V2] virsh: forbid negative vcpu argument to vcpupin.

2014-05-29 Thread Peter Krempa
On 05/29/14 16:51, Eric Blake wrote: > On 05/29/2014 05:47 AM, Peter Krempa wrote: > >> Still not quite right ... vshCommandOptUInt currently wraps negative >> numbers to their 2's complement and stores them in the uint. > > I recently tweaked virstring.c to provide virStrToLong_uip and friends >

Re: [libvirt] [PATCH V2] virsh: forbid negative vcpu argument to vcpupin.

2014-05-29 Thread Peter Krempa
On 05/29/14 05:34, Jincheng Miao wrote: > vcpupin will allow argument --vcpu as a signed number, > and pass it to virDomainPinVcpu directlly without > checking if this value is positive(valid). > >> virsh vcpupin r7 -1 0 > error: numerical overflow: input too large: 4294967295 > > This message is

[libvirt] [PATCH V2] virsh: forbid negative vcpu argument to vcpupin.

2014-05-28 Thread Jincheng Miao
vcpupin will allow argument --vcpu as a signed number, and pass it to virDomainPinVcpu directlly without checking if this value is positive(valid). > virsh vcpupin r7 -1 0 error: numerical overflow: input too large: 4294967295 This message is inaccurate, and the negative vcpu is non-valuable. So