Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 802856 - Missing support for persistent hotplug attach/detach of <hostdev> devices
Missing support for persistent hotplug attach/detach of <hostdev> devices
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.2
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Laine Stump
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-13 12:17 EDT by Laine Stump
Modified: 2012-06-20 02:50 EDT (History)
9 users (show)

See Also:
Fixed In Version: libvirt-0.9.10-6.el6
Doc Type: Bug Fix
Doc Text:
In previous versions of RHEL, a <hostdev> device could be hotplugged to a guest, but making that device persistent across restarts of the guest required separately editing the guest configuration. The patch that closes this bug adds support for persistent hotplug of <hostdev> devices, both to the libvirt API and to the virsh commandline utility.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 02:50:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 15:31:38 EDT

  None (edit)
Description Laine Stump 2012-03-13 12:17:24 EDT
Fixed in this upstream commit:

commit edb6fc3a7f0de4a4881862287b412b66b8153768
Author: Laine Stump <laine@laine.org>
Date:   Wed Mar 7 16:05:34 2012 -0500

    qemu: support persistent hotplug of <hostdev> devices
    
    For some reason, although live hotplug of <hostdev> devices is
    supported, persistent hotplug is not. This patch adds the proper
    VIR_DOMAIN_DEVICE_HOSTDEV cases to the switches in
    qemuDomainAttachDeviceConfig and qemuDomainDetachDeviceConfig.
Comment 1 Laine Stump 2012-03-16 10:23:16 EDT
A backported fix has been posted to rhvirt-patches for inclusion in the RHEL build of libvirt:

http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-March/msg01461.html
Comment 4 hongming 2012-03-20 01:37:41 EDT
Use libvirt-0.9.10-2.el6.x86_64 to reproduce the bug.

#virsh attach-device rhel6 hostdev.xml --persistent
error: Failed to attach device from hostdev.xml
error: unsupported configuration:persistent attach of device is not supported.


Verify steps

1.enable kernel iommu. edit grub.conf
add intel_iommu=on at the end of kernel line.

2.For platform just support vt-d1(host kernel) and host kernel
larger than 171 kernel, do the following steps.
modprobe -r kvm_intel
modprobe -r kvm
modprobe kvm allow_unsafe_assigned_interrupts=1
modprobe kvm_intel


3.# rpm -q libvirt
libvirt-0.9.10-6.el6.x86_64


4.Check device list, prepare hotplug network from host to guest.
computer |
+- pci_0000_00_19_0 
| |
| +- net_eth0_44_37_e6_67_11_a2


4.# virsh nodedev-dumpxml pci_0000_00_19_0

5. Prepare hostdev.xml that like as following
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x00' slot='0x19' function='0x0'/>
</source>
</hostdev>


5.# virsh attach-device rhel6 hostdev.xml --persistent
Device attached successfully

6. In guest, using lspci, and ping to check the host network device is working
fine.

7. # virsh destroy rhel6

8. # virsh start rhel6

9. The host network device still works fine in guest.

10. # virsh detach-device rhel6 hostdev.xml --persistent
Device detached successfully

The host network device automatically be re-attached to host. 

11. # virsh destroy rhel6

12. # virsh start rhel6

Results
The host network device don't exist in guest. 

So it is verified.
Comment 5 Laine Stump 2012-05-08 14:15:09 EDT
    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:
In previous versions of RHEL, a <hostdev> device could be hotplugged to a guest, but making that device persistent across restarts of the guest required separately editing the guest configuration. The patch that closes this bug adds support for persistent hotplug of <hostdev> devices, both to the libvirt API and to the virsh commandline utility.
Comment 7 errata-xmlrpc 2012-06-20 02:50:17 EDT
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/RHSA-2012-0748.html

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