RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1074403 - qemu-kvm can not give any warning hint when set sndbuf with negative value
Summary: qemu-kvm can not give any warning hint when set sndbuf with negative value
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Amos Kong
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-10 06:23 UTC by Jun Li
Modified: 2015-05-25 00:07 UTC (History)
10 users (show)

Fixed In Version: qemu-kvm-1.5.3-68.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 08:04:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0349 0 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2015-03-05 12:27:34 UTC

Description Jun Li 2014-03-10 06:23:44 UTC
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 14:12:52 UTC
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 12:50:19 UTC
This patch resolved this issue, need backport

commit cb45de6798956975c4b13a6233f7a00d2239b61a
Author: Amos Kong <akong>
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>
    Reviewed-by: Michael S. Tsirkin <mst>
    Signed-off-by: Luiz Capitulino <lcapitulino>

Comment 5 Miroslav Rezanina 2014-08-15 07:29:01 UTC
Fix included in qemu-kvm-1.5.3-68.el7

Comment 7 langfang 2014-09-05 07:10:48 UTC
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 07:12:04 UTC
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 08:04:51 UTC
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.