Bug 1517372

Summary: nodedev-dumpxml PCI node devices don't get device details
Product: Red Hat Enterprise Linux 7 Reporter: John Ferlan <jferlan>
Component: libvirtAssignee: John Ferlan <jferlan>
Status: CLOSED ERRATA QA Contact: Jingjing Shao <jishao>
Severity: low Docs Contact:
Priority: low    
Version: 7.5CC: dyuan, jferlan, mtessun, rbalakri, xuzhang, yafu, yalzhang
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-3.9.0-4.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 11:00:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Ferlan 2017-11-24 17:00:09 UTC
Description of problem:



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


How reproducible:


Steps to Reproduce:
1. virsh nodedev-list pci 
2. Using an entry from the list (and not pci_0000_00_00_0):
   virsh nodedev-dumpxml <entry>

Actual results:

1.  virsh nodedev-list pci
pci_0000_00_00_0
pci_0000_00_01_0
pci_0000_00_02_0
pci_0000_00_03_0
...
pci_0000_01_00_0
pci_0000_02_00_0
pci_0000_03_00_0


2. virsh nodedev-dumpxml 
pci_0000_02_00_0
<device>
  <name>pci_0000_02_00_0</name>
  <path>/sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0</path>
  <parent>pci_0000_00_1c_0</parent>
  <driver>
    <name>sdhci-pci</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>2</bus>
    <slot>0</slot>
    <function>0</function>
    <product id='0x8520'>SD/MMC Card Reader Controller</product>
    <vendor id='0x1217'>O2 Micro, Inc.</vendor>
  </capability>
</device>


Expected results:

2. virsh nodedev-dumpxml pci_0000_02_00_0
<device>
  <name>pci_0000_02_00_0</name>
  <path>/sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0</path>
  <parent>pci_0000_00_1c_0</parent>
  <driver>
    <name>sdhci-pci</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>2</bus>
    <slot>0</slot>
    <function>0</function>
    <product id='0x8520'>SD/MMC Card Reader Controller</product>
    <vendor id='0x1217'>O2 Micro, Inc.</vendor>
    <pci-express>
      <link validity='cap' port='0' speed='2.5' width='1'/>
      <link validity='sta' speed='2.5' width='1'/>
    </pci-express>
  </capability>
</device>


NOTE: The <pci-express> device details


Additional info:

Need to backport upstream commit '9bfcf3cc' to properly set privileged field

Comment 3 Xuesong Zhang 2017-11-27 07:08:30 UTC
hi, John,

It seems this BZ is duplicated with one BZ QE found before, which is BZ 1509805.

Comment 4 Erik Skultety 2017-11-27 08:46:12 UTC
*** Bug 1509805 has been marked as a duplicate of this bug. ***

Comment 5 Erik Skultety 2017-11-27 08:52:22 UTC
Since the upstream commit hasn't been mentioned here:

commit 9bfcf3ccdd2a0bb599dff27f97d5c1524cba1b79
Author:     John Ferlan <jferlan>
AuthorDate: Wed Nov 22 10:34:11 2017 -0500
Commit:     John Ferlan <jferlan>
CommitDate: Fri Nov 24 07:17:37 2017 -0500

    nodedev: Restore setting of privileged
    
    Commit id '36555364' removed the setting of the driver->privileged,
    which the udevProcessPCI would need in order to read the PCI device
    configs.
    
    Signed-off-by: John Ferlan <jferlan>

I closed https://bugzilla.redhat.com/show_bug.cgi?id=1509805 as duplicate.

Comment 7 Jingjing Shao 2017-12-04 11:20:06 UTC
Verify this bug as below with libvirt-3.9.0-4.el7.x86_64


# virsh nodedev-list --tree
   +- pci_0000_13_00_1
  |   |   |
  |   |   +- net_ens6f1_90_e2_ba_11_d7_a5
  |   |     
  |   +- pci_0000_13_10_0
  |   |   |
  |   |   +- net_enp19s16_96_a1_94_e6_8a_86


# virsh nodedev-dumpxml pci_0000_13_00_1
<device>
  <name>pci_0000_13_00_1</name>
  <path>/sys/devices/pci0000:00/0000:00:07.0/0000:13:00.1</path>
  <parent>pci_0000_00_07_0</parent>
  <driver>
    <name>ixgbe</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>19</bus>
    <slot>0</slot>
    <function>1</function>
    <product id='0x10fb'>82599ES 10-Gigabit SFI/SFP+ Network Connection</product>
    <vendor id='0x8086'>Intel Corporation</vendor>
    <capability type='virt_functions' maxCount='63'>
      <address domain='0x0000' bus='0x13' slot='0x10' function='0x1'/>
      <address domain='0x0000' bus='0x13' slot='0x10' function='0x3'/>
      <address domain='0x0000' bus='0x13' slot='0x10' function='0x5'/>
      <address domain='0x0000' bus='0x13' slot='0x10' function='0x7'/>
    </capability>
    <iommuGroup number='18'>
      <address domain='0x0000' bus='0x13' slot='0x00' function='0x1'/>
    </iommuGroup>
    <numa node='0'/>
    <pci-express>
      <link validity='cap' port='0' speed='5' width='8'/>
      <link validity='sta' speed='5' width='8'/>
    </pci-express>
  </capability>
</device>


# virsh nodedev-dumpxml pci_0000_13_10_0
<device>
  <name>pci_0000_13_10_0</name>
  <path>/sys/devices/pci0000:00/0000:00:07.0/0000:13:10.0</path>
  <parent>pci_0000_00_07_0</parent>
  <driver>
    <name>ixgbevf</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>19</bus>
    <slot>16</slot>
    <function>0</function>
    <product id='0x10ed'>82599 Ethernet Controller Virtual Function</product>
    <vendor id='0x8086'>Intel Corporation</vendor>
    <capability type='phys_function'>
      <address domain='0x0000' bus='0x13' slot='0x00' function='0x0'/>
    </capability>
    <iommuGroup number='84'>
      <address domain='0x0000' bus='0x13' slot='0x10' function='0x0'/>
    </iommuGroup>
    <numa node='0'/>
    <pci-express>
      <link validity='cap' port='0' width='0'/>
      <link validity='sta' width='0'/>
    </pci-express>
  </capability>
</device>

Comment 11 errata-xmlrpc 2018-04-10 11:00: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.

https://access.redhat.com/errata/RHEA-2018:0704