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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Actually we don't. All callers of vshCommandOptUInt don't expect to use
the wrap-to-2's-complement "feature". I've sent a V3 that does exactly that.

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]