[libvirt] [PATCH 1/2] virsh: check if domiftune parameters fit into UINT

Ján Tomko jtomko at redhat.com
Thu Jul 31 10:00:57 UTC 2014


On 07/30/2014 10:34 PM, John Ferlan wrote:
> 
> 
> On 07/28/2014 09:30 AM, Ján Tomko wrote:
>> We parse the bandwidth rates as unsinged long long,
>> then try to fit them in VIR_TYPED_PARAM_UINT.
>>
>> Report an error if they exceed UINT_MAX instead of
>> quietly using wrong values.
>>
>> https://bugzilla.redhat.com/show_bug.cgi?id=1043735
>> ---
>>  tools/virsh-domain.c | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
>> index ad68aab..f7193cb 100644
>> --- a/tools/virsh-domain.c
>> +++ b/tools/virsh-domain.c
>> @@ -2686,6 +2686,14 @@ cmdDomIftune(vshControl *ctl, const vshCmd *cmd)
>>              vshError(ctl, _("inbound format is incorrect"));
>>              goto cleanup;
>>          }
> 
> I think the parseRateStr() should be modified that way the
> attach-interface can also make use of this range check as well...

cmdAttachInterface is not limited by this range check - it transmits the value
via XML as a string. But I could move the error messages there and use a
different maximum for attach-interface.

Jan

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


More information about the libvir-list mailing list