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 890606 - duplicate virtio-serial addresses are not rejected
Summary: duplicate virtio-serial addresses are not rejected
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 1177584 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-28 05:37 UTC by zhenfeng wang
Modified: 2015-11-19 05:36 UTC (History)
7 users (show)

Fixed In Version: libvirt-1.2.15-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 05:36:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description zhenfeng wang 2012-12-28 05:37:24 UTC
Description of problem:
Better to report an error if there are two same virtio-serial address in the guest's xml
Version-Release number of selected component (if applicable):
kernel-2.6.32-348.el6.x86_64
libvirt-0.10.2-12.el6.x86_64
qemu-kvm-0.12.1.2-2.346.el6.x86_64

How reproducible:
100%
1 prepare a guest add the following to the guest xml
# virsh list --all
rhelnew                        shut off

# virsh edit rhelnew
---
---
  <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/rhelnew.agent'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
----
-----
then save the xml
2 start the guest will report error
# virsh start rhelnew
error: Failed to start domain rhelnew
error: Unable to read from monitor: Connection reset by peer

# virsh start rhelnew
error: Failed to start domain rhelnew
error: internal error process exited while connecting to monitor: 2012-12-27 03:24:14.029+0000: 27788: debug : virFileClose:72 : Closed fd 31
2012-12-27 03:24:14.029+0000: 27788: debug : virFileClose:72 : Closed fd 39
2012-12-27 03:24:14.031+0000: 27788: debug : virFileClose:72 : Closed fd 3
char device redirected to /dev/pts/6
qemu-kvm: -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel1,id=channel1,name=com.redhat.spice.0: virtio-serial-bus: A port already exists at id 1
qemu-kvm: -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel1,id=channel1,name=com.redhat.spice.0: Device 'virtserialport' could not be initialized



Actual results:
it didn't report error while there were two same virtio-serial address exsitting in the guest xml

Expected results:
Better to report an error if there are two same virtio-serial address in the guest's xml ,just like the pci address
# virsh edit rhelnew
---
    <video>
      <model type='qxl' vram='65536' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
----
then save will report error
# virsh edit rhelnew
error: XML error: Attempted double use of PCI Address '0:0:2.0'
Failed. Try again? [y,n,f,?]:

Comment 2 RHEL Program Management 2012-12-31 06:47:15 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 Jiri Denemark 2014-04-04 21:37:21 UTC
This bug was not selected to be addressed in Red Hat Enterprise Linux 6. We will look at it again within the Red Hat Enterprise Linux 7 product.

Comment 8 Ján Tomko 2015-03-02 14:49:01 UTC
*** Bug 1177584 has been marked as a duplicate of this bug. ***

Comment 9 Ján Tomko 2015-03-03 14:47:19 UTC
Upstream patches:
https://www.redhat.com/archives/libvir-list/2015-March/msg00071.html

Comment 11 Ján Tomko 2015-03-17 11:42:39 UTC
Another version of the patches:
https://www.redhat.com/archives/libvir-list/2015-March/msg00821.html

Comment 13 Ján Tomko 2015-04-02 13:06:42 UTC
Fixed upstream by:
commit 5903378834bafb031407ab02ce37dcc9ec782d1f
Author:     Ján Tomko <jtomko>
CommitDate: 2015-04-02 15:00:13 +0200

    Allocate virtio-serial addresses when starting a domain   

git describe: v1.2.14-30-g5903378

Comment 15 Hu Jianwei 2015-05-07 01:46:39 UTC
Verified as below:

[root@localhost ~]# rpm -q libvirt
libvirt-1.2.15-1.el7.x86_64

Prepare a block of xml as below 
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <channel type='pty'>
      <target type='virtio' name='org.linux-kvm.port.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>

Then save the xml with the configuration.
[root@localhost ~]# virsh edit r71
error: XML error: virtio serial port 1 on controller 0 is already occupied
Failed. Try again? [y,n,i,f,?]: 

We can get expected results, move to verified.

Comment 17 errata-xmlrpc 2015-11-19 05:36:41 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/RHBA-2015-2202.html


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