Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 768268 - Libvirt fail to detach PF/VF device when the address of pci device described as decimalism
Libvirt fail to detach PF/VF device when the address of pci device described ...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: Osier Yang
Virtualization Bugs
: Regression
Depends On:
Blocks: 748405
  Show dependency treegraph
 
Reported: 2011-12-16 03:17 EST by yuping zhang
Modified: 2012-06-20 02:39 EDT (History)
7 users (show)

See Also:
Fixed In Version: libvirt-0.9.10-1.el6
Doc Type: Bug Fix
Doc Text:
No documentation needed.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 02:39:09 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 yuping zhang 2011-12-16 03:17:28 EST
Description of problem:

Describe the address of PCI device with decimalism. Hotplug PF/VF successfully,but libvirt fail when hot unplug PF/VF with message "error: no such device in <guest>"

Version-Release number of selected component (if applicable):
libvirt-0.9.8-1.el6.x86_64
libvirt-client-0.9.8-1.el6.x86_64
libvirt-python-0.9.8-1.el6.x86_64
virt-manager-0.9.0-7.el6.x86_64
kernel-2.6.32-220.el6.x86_64
qemu-kvm-0.12.1.2-2.209.el6.x86_64 

How reproducible:
always

Steps to Reproduce:
1.Prepare a PF xml like this.
#cat PF.xml
<hostdev mode='subsystem' type='pci' managed='yes'>
     <source>
         <address bus='3' slot='0' function='1'/>
     </source>
</hostdev>

2.Start a guest.
#virsh start kvm-rhel6.1-i386

3.Hot plug the PF.
 # virsh attach-device kvm-rhel6.1-i386 PF.xml
Device attached successfully

4.Hot unplug the PF.
# virsh detach-device kvm-rhel6.1-i386 PF.xml

Actual results:
error: no such device in kvm-rhel6.1-i386

Expected results:
The PF detached successfully

Additional info:
1.It works well on libvirt-0.9.4-23
2.The detach device will success if update the address with hex,like this:
#cat PF.xml
<hostdev mode='subsystem' type='pci' managed='yes'>
     <source>
         <address bus='0x03' slot='0x0' function='0x01'/>
     </source>
</hostdev>
Comment 3 Alex Jia 2011-12-16 03:25:27 EST
This issue is introduced in commit ea7182c2, the cmdDetachDevice function uses new vshCompleteXMLFromDomain function to find such device in domain.


Alex
Comment 6 Osier Yang 2012-02-07 20:47:16 EST
commit c001eb5bbefd42b3976fe95ce7b9c53dd69a49a0
Author: Osier Yang <jyang@redhat.com>
Date:   Tue Feb 7 23:56:08 2012 +0800

    virsh: Do not check the input XML at virsh layer for cmdDetachDevice
    
    Any device XML doesn't use the same order as libvirt generates, or
    uses decimal for attributes like "slot" of "<address>" will cause
    device detaching to fail, as virsh compares the XML simply earlier
    in strict manner before internal parsing.
    
    This is regression introduced by ea7182c.
Comment 7 zhpeng 2012-02-08 22:06:49 EST
Verified with libvirt-0.9.10-0rc2.el6.x86_64.rpm
Comment 10 zhpeng 2012-02-15 01:10:59 EST
According steps of comment 0, tested with libvirt-0.9.10-1.el6.x86_64 and it passed.

virsh # detach-device rhel6 PF.xml 

Device detached successfully
Comment 11 Osier Yang 2012-05-04 03:24:38 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:
No documentation needed.
Comment 13 errata-xmlrpc 2012-06-20 02:39:09 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.