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 770512 - Virtio serial chardev will be still in use even failed to hot plug a serial port on it
Summary: Virtio serial chardev will be still in use even failed to hot plug a serial p...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Amit Shah
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 676568 923599 969799 973038
TreeView+ depends on / blocked
 
Reported: 2011-12-27 07:31 UTC by Qunfang Zhang
Modified: 2014-07-06 13:44 UTC (History)
9 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.226.el6
Doc Type: Bug Fix
Doc Text:
No documentation necessary
Clone Of:
: 923599 (view as bug list)
Environment:
Last Closed: 2012-06-20 11:38:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0746 0 normal SHIPPED_LIVE qemu-kvm bug fix and enhancement update 2012-06-19 19:31:48 UTC

Description Qunfang Zhang 2011-12-27 07:31:30 UTC
Description of problem:
Hot plug a virtio serial port to a chardev but let it failed. For example, giving it a wrong "nr" value. But, the chardev will be still in use though no serial port is plugged on it. So the chardev can not be used.

Version-Release number of selected component (if applicable):
kernel-2.6.32-220.el6.x86_64
qemu-kvm-0.12.1.2-2.213.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Boot a guest with virtio serial bus and chardev but no serial port, for example:
/usr/libexec/qemu-kvm ....... -device virtio-serial-pci,id=virtio-serial0,max_ports=3,vectors=4,bus=pci.0,addr=0x5 -chardev socket,id=channel0,path=/var/lib/libvirt/qemu/rhel58.channel0,server,nowait -chardev socket,id=channel1,path=/var/lib/libvirt/qemu/rhel58.channel1,server,nowait

2. Hot plug a virtio serial port on the first chardev "channel0".
(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=1,chardev=channel0,name=org.linux-kvm.port.0,id=port0

3. Hot plug another serial port on the second chardev "channel1" but with a wrong "nr" value to let it failed to plug.

(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=1,chardev=channel1,name=org.linux-kvm.port.1,id=port1
virtio-serial-bus: A port already exists at id 1
Device 'virtserialport' could not be initialized

4. Hot plug the serial port again with correct "nr" value.
(qemu)  device_add virtserialport,bus=virtio-serial0.0,nr=2,chardev=channel1,name=org.linux-kvm.port.1,id=port1

  
Actual results:
After step4, can not hot plug the second serial port to the chardev. and (qemu)info qtree shows there's only 1 virtio serial port "port0" and chardev "channel0"

Expected results:
The second chardev "channel1" should NOT be used if actually failed to plug a serial port on it.

Additional info:

Comment 2 Qunfang Zhang 2011-12-27 07:34:55 UTC
After step 4 in the bug description, qemu monitor shows:

(qemu)  device_add virtserialport,bus=virtio-serial0.0,nr=2,chardev=channel1,name=org.linux-kvm.port.1,id=port1

Property 'virtserialport.chardev' can't take value 'channel1', it's in use

Comment 3 Amit Shah 2011-12-27 08:37:05 UTC
This is going to need the chardev hot-plug/unplug patches (Bug 676568).

Instead of closing as a dup, I'll let this bug remain open so that we test this scenario when that bug is closed.

Comment 4 Markus Armbruster 2012-01-13 07:54:48 UTC
This is a bug in the chardev - qdev connection code.

A typical use case for dynamic chardev - qdev connection is full hot plug/unplug of chardevs (bug 676568).

But other use cases exist.  For instance, you can unplug the qdev and reuse the same chardev for another qdev.

But currently a qdev initialization can fail in a way that leaves the chardev unusable for another qdev.  That's this bug.  It needs fixing regardless of chardev hot plug/unplug.

Thus, I'm reverting the dependency between this one and bug 676568: this one blocks bug 676568.

Comment 5 Amit Shah 2012-01-13 10:05:14 UTC
While testing, please also test the case in Bug 700512.  It should continue to remain fixed.  The fix in bug 700512 will be reverted for a generic fix, which will fix both these bugs.

Comment 11 daiwei 2012-02-14 06:52:15 UTC
Reproduced this issue with steps and environment as follows: 

# uname -r ;rpm -q qemu-kvm

2.6.32-220.el6.x86_64
qemu-kvm-0.12.1.2-2.209.el6_2.1.x86_64

1. Boot a guest with virtio serial bus and chardev but no serial port

2. Hot plug a virtio serial port on the first chardev "channel0"

3. Hot plug another serial port on the second chardev "channel1" but with a
wrong "nr" value to let it failed to plug.

(qemu) device_add
virtserialport,bus=virtio-serial0.0,nr=1,chardev=channel1,name=org.linux-kvm.port.1,id=port1
virtio-serial-bus: A port already exists at id 1
Device 'virtserialport' could not be initialized

4. Hot plug the serial port again with correct "nr" value.

after step 4,qemu monitor shows:
(qemu)  device_add
virtserialport,bus=virtio-serial0.0,nr=2,chardev=channel1,name=org.linux-kvm.port.1,id=port1

Property 'virtserialport.chardev' can't take value 'channel1', it's in use

(qemu)info qtree 
 shows there's only 1 virtio serial port "port0" and chardev
"channel0"


Verified this issue with steps and environment as follows:

# uname -r ;rpm -q qemu-kvm

2.6.32-220.el6.x86_64
qemu-kvm-0.12.1.2-2.226.el6.x86_64

redo above step1 ~ step4.
after step4, qemu monitor does not report an error.

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

(qemu) info tree shows both <port0,channel0> and <port1,channel1>.

So,this bug had been fixed.

Comment 14 Amit Shah 2012-04-24 13:04:51 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No documentation necessary

Comment 15 errata-xmlrpc 2012-06-20 11:38:17 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-2012-0746.html


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