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:
When using a model of separate network and guest XML's (using forward mode) to start a guest on RHEL 6.2, a simple test of pci-hotplug, pci-unplug and pci-hotplug again of PCI device fails.
Version-Release number of selected component (if applicable):
RHEL 6.2 : 2.6.32-220.el6.x86_64
Libvirt : libvirt-0.9.4-23.el6.x86_64
qemu-kvm : qemu-kvm-0.12.1.2-2.209.el6.x86_64
How reproducible:
Always
Steps to Reproduce:
1. virsh net-define network.xml
2. virsh define guest.xml
3. virsh start guest
4. virsh qemu-monitor-command --domain guest --cmd 'info pci' --hmp
Observe result.
5. virsh attach-device guest hostdev.xml
6. virsh qemu-monitor-command --domain guest --cmd 'info pci' --hmp
Observe result
7. virsh detach-device guest hostdev.xml
8. virsh qemu-monitor-command --domain guest --cmd 'info pci' --hmp
Observe result
9. virsh attach-device guest hostdev.xml
Actual results:
error: Failed to attach device from /home/sshah/xml/hostdev_attach.xml
error: internal error unable to execute QEMU command 'device_add': Duplicate ID 'hostdev0' for device
Expected results:
The second hotplug should succeed without errors and on detach-device hostdev0 should be removed from the info pci list of the qemu-monitor-command
Additional info:
Observations in the Actual results:
1) After the first attach-device a new device called hostdev0 is added to the info pci list of the qemu-monitor-command
2) After the first detach-device the hostdev0 entry still remains in the info pci list of the qemu-monitor-command
The XML used to create the guest:
network.xml:
<network>
<name>bridge-network</name>
<uuid>81ff2340-c91e-6742-64da-4a736edb9a8f</uuid>
<forward mode="bridge"/>
<bridge name="br1"/>
</network>
hostdev.xml:
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address bus='0x04' slot='0x00' function='0x2'/>
</source>
</hostdev>
guest.xml:
<domain type='kvm'>
<name>guest</name>
<uuid>a4452511-fcb7-864a-dbcc-f4c66f821956</uuid>
<memory>524288</memory>
<currentMemory>524288</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='cdrom'/>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<source file='/var/lib/libvirt/images/vguestc2.img'/>
<target dev='hda' bus='virtio'/>
<alias name='virtio-disk0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw' io='threads'/>
<source file='/misc/linux-dist/redhat/rhel6/x86_64/rhel-workstation-supplementary-6.0-x86_64-dvd.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<alias name='ide-disk0'/>
</disk>
<interface type='network'>
<source network='bridge-network'/>
<model type='virtio'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/0'/>
<target port='0'/>
<alias name='serial0'/>
</serial>
<console type='pty' tty='/dev/pts/0'>
<source path='/dev/pts/0'/>
<target type='serial' port='0'/>
<alias name='serial0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5900' autoport='yes'/>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<alias name='video0'/>
</video>
<memballoon model='virtio'>
<alias name='balloon0'/>
</memballoon>
</devices>
</domain>
I believe you're hitting BZ 696877, so I'm closing this as a duplicate. Please feel free to reopen if that turns out not to be the case.
*** This bug has been marked as a duplicate of bug 696877 ***
Comment 3Don Dutile (Red Hat)
2012-02-06 17:31:45 UTC
Could you provide guest.xml & hostdev.xml files?
what was the guest? (linux, win, what version of the guest, e.g., rhel5, winxp-32, etc.)
Description of problem: When using a model of separate network and guest XML's (using forward mode) to start a guest on RHEL 6.2, a simple test of pci-hotplug, pci-unplug and pci-hotplug again of PCI device fails. Version-Release number of selected component (if applicable): RHEL 6.2 : 2.6.32-220.el6.x86_64 Libvirt : libvirt-0.9.4-23.el6.x86_64 qemu-kvm : qemu-kvm-0.12.1.2-2.209.el6.x86_64 How reproducible: Always Steps to Reproduce: 1. virsh net-define network.xml 2. virsh define guest.xml 3. virsh start guest 4. virsh qemu-monitor-command --domain guest --cmd 'info pci' --hmp Observe result. 5. virsh attach-device guest hostdev.xml 6. virsh qemu-monitor-command --domain guest --cmd 'info pci' --hmp Observe result 7. virsh detach-device guest hostdev.xml 8. virsh qemu-monitor-command --domain guest --cmd 'info pci' --hmp Observe result 9. virsh attach-device guest hostdev.xml Actual results: error: Failed to attach device from /home/sshah/xml/hostdev_attach.xml error: internal error unable to execute QEMU command 'device_add': Duplicate ID 'hostdev0' for device Expected results: The second hotplug should succeed without errors and on detach-device hostdev0 should be removed from the info pci list of the qemu-monitor-command Additional info: Observations in the Actual results: 1) After the first attach-device a new device called hostdev0 is added to the info pci list of the qemu-monitor-command 2) After the first detach-device the hostdev0 entry still remains in the info pci list of the qemu-monitor-command The XML used to create the guest: network.xml: <network> <name>bridge-network</name> <uuid>81ff2340-c91e-6742-64da-4a736edb9a8f</uuid> <forward mode="bridge"/> <bridge name="br1"/> </network> hostdev.xml: <hostdev mode='subsystem' type='pci' managed='yes'> <source> <address bus='0x04' slot='0x00' function='0x2'/> </source> </hostdev> guest.xml: <domain type='kvm'> <name>guest</name> <uuid>a4452511-fcb7-864a-dbcc-f4c66f821956</uuid> <memory>524288</memory> <currentMemory>524288</currentMemory> <vcpu>1</vcpu> <os> <type arch='x86_64' machine='pc'>hvm</type> <boot dev='cdrom'/> <boot dev='hd'/> </os> <features> <acpi/> <apic/> <pae/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/libexec/qemu-kvm</emulator> <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='none'/> <source file='/var/lib/libvirt/images/vguestc2.img'/> <target dev='hda' bus='virtio'/> <alias name='virtio-disk0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw' io='threads'/> <source file='/misc/linux-dist/redhat/rhel6/x86_64/rhel-workstation-supplementary-6.0-x86_64-dvd.iso'/> <target dev='hdc' bus='ide'/> <readonly/> <alias name='ide-disk0'/> </disk> <interface type='network'> <source network='bridge-network'/> <model type='virtio'/> </interface> <serial type='pty'> <source path='/dev/pts/0'/> <target port='0'/> <alias name='serial0'/> </serial> <console type='pty' tty='/dev/pts/0'> <source path='/dev/pts/0'/> <target type='serial' port='0'/> <alias name='serial0'/> </console> <input type='mouse' bus='ps2'/> <graphics type='vnc' port='5900' autoport='yes'/> <video> <model type='cirrus' vram='9216' heads='1'/> <alias name='video0'/> </video> <memballoon model='virtio'> <alias name='balloon0'/> </memballoon> </devices> </domain>