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

Eric Blake eblake at redhat.com
Thu May 29 14:51:08 UTC 2014


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 unsigned numbers.

The intent was that we need to make a case-by-case decision on which of
the two parsing styles to use - sometimes, wrapping -1 to max is
desirable, other times it is not.

> 
> We need to modify the vshCommandOptUInt helper to reject negative numbers.

It may mean that we need two flavors of vshCommandOptUInt.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140529/d690bdfe/attachment-0001.sig>


More information about the libvir-list mailing list