Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1074403 - qemu-kvm can not give any warning hint when set sndbuf with negative value
qemu-kvm can not give any warning hint when set sndbuf with negative value
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
x86_64 Linux
low Severity low
: rc
: ---
Assigned To: Amos Kong
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-10 02:23 EDT by Jun Li
Modified: 2015-05-24 20:07 EDT (History)
10 users (show)

See Also:
Fixed In Version: qemu-kvm-1.5.3-68.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 03:04:51 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0349 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2015-03-05 07:27:34 EST

  None (edit)
Description Jun Li 2014-03-10 02:23:44 EDT
Description of problem:
qemu-kvm can not give any warning hint when set sndbuf with negative value.
But when set sndbuf with other illegal value(such as: -abc), qemu-kvm will give a friendly hint.

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-1.5.3-50.el7.x86_64
3.10.0-99.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot guest with following cli:
# /usr/libexec/qemu-kvm -M pc -m 4G -smp 4 -vnc :1 -monitor stdio -drive file=/home/juli/win2012r2-64.qcow2,if=none,id=sys,cache=none -device virtio-scsi-pci,id=scsi0 -device scsi-hd,id=dev-sys,drive=sys,bus=scsi0.0 -netdev tap,id=tap1,queues=3,vhost=off,vhostforce=off,script=/etc/qemu-ifup,sndbuf=-123456789 -device virtio-net-pci,netdev=tap1,id=net1,mq=on,mac=00:15:17:6c:c7:11,status=on
2.
3.

Actual results:
After step1, qemu-kvm will boot up as normal.

Expected results:
qemu-kvm will give some warning hint. As
# /usr/libexec/qemu-kvm -M pc -m 4G -smp 4 -vnc :1 -monitor stdio -drive file=/home/juli/win2012r2-64.qcow2,if=none,id=sys,cache=none -device virtio-scsi-pci,id=scsi0 -device scsi-hd,id=dev-sys,drive=sys,bus=scsi0.0 -netdev tap,id=tap1,queues=3,vhost=off,vhostforce=off,script=/etc/qemu-ifup,sndbuf=-abc -device virtio-net-pci,netdev=tap1,id=net1,mq=on,mac=00:15:17:6c:c7:11,status=on 
qemu-kvm: -netdev tap,id=tap1,queues=3,vhost=off,vhostforce=off,script=/etc/qemu-ifup,sndbuf=-abc: Parameter 'sndbuf' expects a size value representible as a non-negative int64

Additional info:
Comment 2 Amos Kong 2014-04-27 10:12:52 EDT
We use default sndbuf (INT_MAX) if user assigns an invalid sndbuf. I posted a patch to upstream to add error note in this case.

http://marc.info/?l=qemu-devel&m=139860777404195&w=3

# qemu ... -netdev tap,id=h0,queues=1,sndbuf=2147483648
qemu-system-x86_64: -netdev tap,id=h0,queues=1,sndbuf=2147483648: given sndbuf isn't an integer, or it's larger than INT_MAX(2147483647). use default sndbuf(2147483647)

# qemu ... -netdev tap,id=h0,queues=1,sndbuf=-1234
qemu-system-x86_64: -netdev tap,id=h0,queues=1,sndbuf=-1234: given sndbuf isn't an integer, or it's larger than INT_MAX(2147483647). use default sndbuf(2147483647)
Comment 3 Amos Kong 2014-07-06 08:50:19 EDT
This patch resolved this issue, need backport

commit cb45de6798956975c4b13a6233f7a00d2239b61a
Author: Amos Kong <akong@redhat.com>
Date:   Mon Apr 28 13:53:49 2014 +0800

    qapi: treat all negative return of strtosz_suffix() as error
    
    strtosz_suffix() might return negative error, this patch fixes
    the error handling.
    
    This patch also changes to handle error in the if statement
    rather than handle success specially, this will make this use
    of strtosz_suffix consistent with all other uses.
    
    Signed-off-by: Amos Kong <akong@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Comment 5 Miroslav Rezanina 2014-08-15 03:29:01 EDT
Fix included in qemu-kvm-1.5.3-68.el7
Comment 7 langfang 2014-09-05 03:10:48 EDT
Reproduce this bug as follow version:
Host
# uname -r
3.10.0-144.el7.x86_64
# rpm -q qemu-kvm-rhev
qemu-kvm-rhev-1.5.3-30.el7.x86_64

Steps

1.Boot guest
...
-netdev tap,id=tap1,queues=3,vhost=off,vhostforce=off,script=/etc/qemu-ifup,sndbuf=-11111 -device virtio-net-pci,netdev=tap1,id=net1,mq=on,mac=00:15:17:6c:c7:11,status=on...

Results:
guest boot up


*Verify this bug as follow version: Intel machine&qemu-kvm-rhev 

Host:
# uname -r
3.10.0-144.el7.x86_64
# rpm -q qemu-kvm-rhev
qemu-kvm-rhev-2.1.0-3.el7.x86_64


Results:
...qemu-kvm: -netdev tap,id=tap1,queues=3,vhost=off,vhostforce=off,script=/etc/qemu-ifup,sndbuf=-11111: Parameter 'sndbuf' expects a size value representible as a non-negative int64...

*Verify this bug on AMD &qemu-kvm version:
# uname -r
3.10.0-147.el7.x86_64
# rpm -q qemu-kvm
qemu-kvm-1.5.3-69.el7.x86_64


qemu-kvm: -netdev tap,id=tap1,queues=3,vhost=off,vhostforce=off,script=/etc/qemu-ifup,sndbuf=-22222222222222222: Parameter 'sndbuf' expects a size value representible as a non-negative int64


Addtional info

also tried other parameters,work well

According to above test ,this bug has been fixed.
Comment 8 langfang 2014-10-10 03:12:04 EDT
Also tried as follow version:
Host:Intel
# uname -r
3.10.0-171.el7.x86_64
# rpm -q qemu-kvm-rhev
qemu-kvm-rhev-2.1.2-1.el7.x86_64

Results:
qemu-kvm: -netdev tap,id=tap1,queues=3,vhost=off,vhostforce=off,script=/etc/qemu-ifup,sndbuf=-abc: Parameter 'sndbuf' expects a size value representible as  a non-negative int64


According to comment7 and comment8,this bug has been fixed.
Comment 11 errata-xmlrpc 2015-03-05 03:04:51 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0349.html

Note You need to log in before you can comment on or make changes to this bug.