Bug 802856 - Missing support for persistent hotplug attach/detach of <hostdev> devices
Summary: Missing support for persistent hotplug attach/detach of <hostdev> devices
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Laine Stump
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-13 16:17 UTC by Laine Stump
Modified: 2012-06-20 06:50 UTC (History)
9 users (show)

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.
Clone Of:
Environment:
Last Closed: 2012-06-20 06:50:17 UTC


Attachments (Terms of Use)


Links
System 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 19:31:38 UTC

Description Laine Stump 2012-03-13 16:17:24 UTC
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 14:23:16 UTC
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 05:37:41 UTC
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 18:15:09 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:
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 06:50: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/RHSA-2012-0748.html


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