Bug 797728

Summary: qemu-kvm allows a value of -1 for uint32 qdev property types
Product: Red Hat Enterprise Linux 6 Reporter: FuXiangChun <xfu>
Component: qemu-kvmAssignee: Amit Shah <amit.shah>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 6.3CC: acathrow, bsarathy, chayang, flang, juzhang, michen, mkenneth, qzhang, rhod, shu, sluo, tburke, virt-maint, wdai
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.299.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 07:32:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description FuXiangChun 2012-02-27 07:00:13 UTC
Description of problem:
nr option should not support negative,Guest works well when booting guest with nr=-1 value. and "info qtree" get below message from monitor.
"bus-prop: nr = 1" 

Version-Release number of selected component (if applicable):
qemu version:
qemu-kvm-0.12.1.2-2.231.el6.x86_64

host kernel version:
2.6.32-235.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. boot guest command line
/usr/libexec/qemu-kvm -enable-kvm -M rhel6.2.0 -smp 4 -m 4G -name win2008r2 -uuid 3f2ea5cd-3d29-48ff-aab2-23df1b6ae213 -drive file=/dev/fuxc/chardev-fuxc,cache=none,if=none,rerror=stop,werror=stop,id=drive-virtio-disk0,format=qcow2 -device virtio-blk-pci,drive=drive-virtio-disk0,id=device-virtio-disk0 -netdev tap,script=/etc/qemu-ifup,id=netdev0 -device virtio-net-pci,netdev=netdev0,id=device-net0 -boot menu=on -usb -device usb-tablet,id=input0 -monitor stdio -chardev pty,id=channel1 -device virtio-serial-pci,id=virtio-serial1 -device virtserialport,bus=virtio-serial1.0,id=test1,chardev=channel1,name=org.linux-kvm.port.1,nr=-1 -spice disable-ticketing,port=5911

2.info qtree
"bus-prop: nr = 1"
3.
  
Actual results:
guest boot successful with nr=-1 option

Expected results:
guest boot fail with nr=-1 option 

Additional info:

Comment 5 RHEL Program Management 2012-07-10 06:06:22 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 6 RHEL Program Management 2012-07-11 02:03:04 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 11 Qunfang Zhang 2012-11-08 06:49:33 UTC
Reproduced on qemu-kvm-0.12.1.2-2.295.el6.x86_64 and verified pass on qemu-kvm-0.12.1.2-2.334.el6.x86_64.

Reproduction:

1. Boot guest with some negative value for qdev property, like 'nr=-1' for virtio serial port, or "vectors=-1 for virtio-blk-pci or virtio-net-pci" :
/usr/libexec/qemu-kvm .... -device virtio-serial-pci,id=virtio-serial1 -device virtserialport,bus=virtio-serial1.0,id=test1,chardev=channel1,name=org.linux-kvm.port.1,nr=-1

2. (qemu)info qtree
......
 bus: virtio-serial1.0
          type virtio-serial-bus
          dev: virtserialport, id "test1"
            dev-prop: chardev = channel1
            bus-prop: nr = 1
            bus-prop: name = "org.linux-kvm.port.1"
             dev-prop-int: id: 1
             dev-prop-int: guest_connected: 0
             dev-prop-int: host_connected: 1
             dev-prop-int: throttled: 0
......

Result:
The guest can boot up with negative value like -1 for qdev property. 

Verification:
Boot guest with "nr=-1" for virtio serial port and "vectors=-1" for virtio-blk-pci.

Result:
Failed to boot up guest and there's related prompt.

qemu-kvm: -device virtserialport,bus=virtio-serial1.0,id=test1,chardev=channel1,name=org.linux-kvm.port.1,nr=-10000: Property 'virtserialport.nr' doesn't take value '-10000'


qemu-kvm: -device virtio-net-pci,netdev=netdev0,id=device-net0,vectors=-1: Property 'virtio-net-pci.vectors' doesn't take value '-1'

So, based on above, this issue is fixed.

Comment 13 errata-xmlrpc 2013-02-21 07:32:32 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.

http://rhn.redhat.com/errata/RHBA-2013-0527.html