RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 768268 - Libvirt fail to detach PF/VF device when the address of pci device described as decimalism
Summary: Libvirt fail to detach PF/VF device when the address of pci device described ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Osier Yang
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 748405
TreeView+ depends on / blocked
 
Reported: 2011-12-16 08:17 UTC by yuping zhang
Modified: 2012-06-20 06:39 UTC (History)
7 users (show)

Fixed In Version: libvirt-0.9.10-1.el6
Doc Type: Bug Fix
Doc Text:
No documentation needed.
Clone Of:
Environment:
Last Closed: 2012-06-20 06:39:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 19:31:38 UTC

Description yuping zhang 2011-12-16 08:17:28 UTC
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 08:25:27 UTC
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-08 01:47:16 UTC
commit c001eb5bbefd42b3976fe95ce7b9c53dd69a49a0
Author: Osier Yang <jyang>
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-09 03:06:49 UTC
Verified with libvirt-0.9.10-0rc2.el6.x86_64.rpm

Comment 10 zhpeng 2012-02-15 06:10:59 UTC
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 07:24:38 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 13 errata-xmlrpc 2012-06-20 06:39:09 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.