Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 573934

Summary: can reattach pci device to host while it is using by guest
Product: Red Hat Enterprise Linux 5 Reporter: zhanghaiyan <yoyzhang>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 5.5CC: berrange, dallan, eblake, jialiu, mzhan, virt-maint, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.8.2-5.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-31 21:51:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description zhanghaiyan 2010-03-16 08:52:57 UTC
Description of problem:
can reattach pci device to host while it is using by guest

Version-Release number of selected component (if applicable):
- kernel-xen-2.6.18-192.el5.x86_64.rpm   
- xen-3.0.3-105.el5.x86_64.rpm  
- xen-libs-3.0.3-105.el5.i386.rpm   
- libvirt-0.6.3-33.el5.x86_64.rpm  


How reproducible:
100%

Steps to Reproduce:
1. Detach VF/PF pci device from host, 
   # virsh nodedev-dettach pci_8086_10ca
2. Hotplug VF/PF pci device to running guest
   # virsh attach-device <guestname> <VF/PF>.xml
3. In guest, could see the VF/PF by #lspci 
4. on host, # virsh nodedev-reattach pci_8086_10ca
    # vish nodedev-reset pci_8086_10ca

  
Actual results:
reattach and reset pass

Expected results:
reset should fail and pops up a dialog saying 'cannot reset active deivce'

Additional info:
This bug cannot be reproduced on kvm system

Comment 1 Jiri Denemark 2010-09-02 11:59:02 UTC
Fixed in libvirt-0.8.2-1.el5

Comment 3 Eric Blake 2010-09-13 22:32:29 UTC
Back to POST until this patch is included (it missed 0.8.2-4.el5):
http://post-office.corp.redhat.com/archives/rhvirt-patches/2010-September/msg00296.html

Comment 4 Jiri Denemark 2010-09-21 15:54:08 UTC
Fix built in libvirt-0.8.2-5.el5

Comment 6 Johnny Liu 2010-10-19 04:38:57 UTC
Re-test this bug with libvirt-0.8.2-7.el5 on RHEL5u6 Server X86_64 Xen, but failed.

kernel-xen-2.6.18-227.el5
xen-libs-3.0.3-117.el5
xen-3.0.3-117.el5
libvirt-0.8.2-7.el5

1. Enable vt-d for xen kernel
add "iommu=1" to kernel line
2. Start a guest, and load acpiphp module in guest.
3. Detach pci NIC device from host
# virsh nodedev-dettach pci_8086_10de
# virsh nodedev-reset pci_8086_10de
4.Hotplug the pci device to running guest
# cat pci-device.xml
      <hostdev mode='subsystem' type='pci'>
      <source>
      <address domain='0x0000' bus='0x00' slot='0x19' function='0x0'/>
      </source>
      </hostdev>
#virsh attach-device <guestname> pci-device.xml
5. On host, try to re-attach the device to host when the device is using
# virsh nodedev-reattach pci_8086_10de

Then host will reboot

Comment 7 Jiri Denemark 2010-10-26 10:08:12 UTC
*** Bug 646749 has been marked as a duplicate of this bug. ***

Comment 10 RHEL Program Management 2011-01-11 19:59:16 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 11 RHEL Program Management 2011-01-11 22:59:32 UTC
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.