Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
First, attach a rng device with pci address set to higher than the current occupied pci address in guest.
Second, attach the rng device again. It failed with expected error:
error: XML error: Attempted double use of PCI Address 0000:00:0c.0
Then,attach a rng device or other device without specified pci address. It failed with:
error: internal error: unable to execute QEMU command 'device_add': PCI: slot 12 function 0 not available for rtl8139, in use by virtio-rng-pci
Version-Release number of selected component:
libvirt-3.2.0-5.virtcov.el7.x86_64
qemu-kvm-rhev-2.9.0-5.el7.x86_64
How reproducible:
100%
Steps to Reproduce:
0.Prepare a guest, whose pci address has been occupied from 0000:00:01 to 0000:00:0b
1. Prepare a rng xml with pci address set to 0000:00:0c like below:
# cat random-pci.xml
<rng model='virtio'>
<backend model='random'>/dev/random</backend>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
</rng>
2.Start guest
# virsh start rhel7.4
Domain rhel7.4 started
3.Attach rng device:
# virsh attach-device rhel7.4 random-pci.xml
Device attached successfully
4.Attach same rng device again:
# virsh attach-device rhel7.4 random-pci.xml
error: Failed to attach device from random-pci.xml
error: XML error: Attempted double use of PCI Address 0000:00:0c.0
5.Remove address from random-pci.xml and re-attach
# cat random.xml
<rng model='virtio'>
<backend model='random'>/dev/random</backend>
</rng>
# virsh attach-device rhel7.4 random.xml
error: Failed to attach device from random.xml
error: internal error: unable to execute QEMU command 'device_add': PCI: slot 12 function 0 not available for virtio-rng-pci, in use by virtio-rng-pci
7.Attach an interface without specified pci address:
# cat interface.xml
<interface type='network'>
<source network='default' bridge='virbr0'/>
</interface>
# virsh attach-device rhel7.4 interface.xml
error: Failed to attach device from interface.xml
error: internal error: unable to execute QEMU command 'device_add': PCI: slot 12 function 0 not available for rtl8139, in use by virtio-rng-pci
Actual results:
In step6&&7, libvirt still use 0000:00:0c.0 when attaching rng/interface device
Expected results:
In step6&&7, libvirt should use new pci address and attach should succeed
Pushed as:
commit f25f30aff548636d0c8782d3eaee049c77548dd5
Author: Ján Tomko <jtomko>
CommitDate: 2017-05-22 10:29:01 +0200
Do not release unreserved address in qemuDomainAttachRNGDevice
Only set releaseaddr to true after the address has been
reserved successfully.
https://bugzilla.redhat.com/show_bug.cgi?id=1452581
Reviewed-by: John Ferlan <jferlan>
git describe: v3.3.0-113-gf25f30a
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://access.redhat.com/errata/RHEA-2017:1846
Description of problem: First, attach a rng device with pci address set to higher than the current occupied pci address in guest. Second, attach the rng device again. It failed with expected error: error: XML error: Attempted double use of PCI Address 0000:00:0c.0 Then,attach a rng device or other device without specified pci address. It failed with: error: internal error: unable to execute QEMU command 'device_add': PCI: slot 12 function 0 not available for rtl8139, in use by virtio-rng-pci Version-Release number of selected component: libvirt-3.2.0-5.virtcov.el7.x86_64 qemu-kvm-rhev-2.9.0-5.el7.x86_64 How reproducible: 100% Steps to Reproduce: 0.Prepare a guest, whose pci address has been occupied from 0000:00:01 to 0000:00:0b 1. Prepare a rng xml with pci address set to 0000:00:0c like below: # cat random-pci.xml <rng model='virtio'> <backend model='random'>/dev/random</backend> <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/> </rng> 2.Start guest # virsh start rhel7.4 Domain rhel7.4 started 3.Attach rng device: # virsh attach-device rhel7.4 random-pci.xml Device attached successfully 4.Attach same rng device again: # virsh attach-device rhel7.4 random-pci.xml error: Failed to attach device from random-pci.xml error: XML error: Attempted double use of PCI Address 0000:00:0c.0 5.Remove address from random-pci.xml and re-attach # cat random.xml <rng model='virtio'> <backend model='random'>/dev/random</backend> </rng> # virsh attach-device rhel7.4 random.xml error: Failed to attach device from random.xml error: internal error: unable to execute QEMU command 'device_add': PCI: slot 12 function 0 not available for virtio-rng-pci, in use by virtio-rng-pci 7.Attach an interface without specified pci address: # cat interface.xml <interface type='network'> <source network='default' bridge='virbr0'/> </interface> # virsh attach-device rhel7.4 interface.xml error: Failed to attach device from interface.xml error: internal error: unable to execute QEMU command 'device_add': PCI: slot 12 function 0 not available for rtl8139, in use by virtio-rng-pci Actual results: In step6&&7, libvirt still use 0000:00:0c.0 when attaching rng/interface device Expected results: In step6&&7, libvirt should use new pci address and attach should succeed