Bug 748405

Summary: PCI device will be driver reprobing without honoring the original states
Product: Red Hat Enterprise Linux 6 Reporter: Osier Yang <jyang>
Component: libvirtAssignee: Osier Yang <jyang>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: medium    
Version: 6.3CC: acathrow, ajia, dallan, dyuan, mzhan, rwu, veillard, weizhan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.9.9-1.el6 Doc Type: Bug Fix
Doc Text:
No documentation needed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 06:35:58 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:
Bug Depends On: 768268    
Bug Blocks:    

Description Osier Yang 2011-10-24 11:24:53 UTC
Description of problem:

How to reproduce

1) make sure the device is already detached from host (bound to pci-stub)
2) virsh attach-device domain pci.xml
3) virsh detach-device domain pci.xml

You will see the device will be bound to some other driver if driver reprobing succeeded. The problem can be reproduced regardless of whether the device
is "managed" or not. That means another problem is "it should never try to
reattach the device to host when the device is not managed".

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Osier Yang 2011-10-24 11:27:52 UTC
http://www.redhat.com/archives/libvir-list/2011-October/msg00774.html

patch posted to upstream

Comment 4 Osier Yang 2011-12-15 02:16:24 UTC
Patch committed to upstream.

Comment 5 Daniel Veillard 2012-01-09 08:43:19 UTC
Upstream commit a0aec362e858e30da5cd423d9375d4a27abf4ec7

Daniel

Comment 7 weizhang 2012-01-10 10:23:38 UTC
This bug is blocked by bug 768268, so I will verify this bug after bug 768268 fixed.

Step:
1. virsh nodedev-dettach pci_0000_00_19_0
2. readlink -f /sys/bus/pci/devices/0000\:00\:19.0/driver/
/sys/bus/pci/drivers/pci-stub
3. virsh attach-device domain pci.xml
cat pci.xml
          <hostdev mode='subsystem' type='pci' managed='yes'>
            <source>
              <address bus='0' slot='25' function='0'/>
            </source>
          </hostdev>
4. virsh detach-device domain pci.xml
5. readlink -f /sys/bus/pci/devices/0000\:00\:19.0/driver/
should also be 
/sys/bus/pci/drivers/pci-stub

Comment 8 weizhang 2012-02-21 02:48:38 UTC
Verify pass on 

qemu-kvm-0.12.1.2-2.225.el6.x86_64
kernel-2.6.32-225.el6.x86_64
libvirt-0.9.10-1.el6.x86_64

The result is as comment 7 shows, after detach from guest with managd=yes, the driver is also bounded to pci-stub, but not e1000e

Comment 9 Osier Yang 2012-05-04 10: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:
No documentation needed.

Comment 11 errata-xmlrpc 2012-06-20 06:35:58 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