[libvirt] [PATCH] virNetDevBandwidthParseRate: Reject negative values

Ján Tomko jtomko at redhat.com
Mon Aug 10 11:03:21 UTC 2015


On Fri, Aug 07, 2015 at 05:12:12PM +0200, Michal Privoznik wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1022292
> 
> The following XML really does not make any sense:
> 
> <inbound average="-1" burst="-2" peak="-3" floor="-4"/>
> 
> There can't be a negative packet rate. Well, so far we haven't
> assigned any meaning to it. So reject it unless users harm themselves,
> because otherwise we turn the negative numbers into really big values.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  src/conf/netdev_bandwidth_conf.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 

ACK,

would be nicer with a test case.

Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150810/948d2a07/attachment-0001.sig>


More information about the libvir-list mailing list