Bug 583064

Summary: Virtio Net/Disk block devices get wrong parent in node device info
Product: Red Hat Enterprise Linux 6 Reporter: Daniel Berrangé <berrange>
Component: kernelAssignee: Michael S. Tsirkin <mst>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: dallan, gcosta, gleb, lihuang, michen, qcai, szhou, tburke, virt-maint
Target Milestone: beta   
Target Release: 6.1   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kernel-2.6.32-112.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 570130 Environment:
Last Closed: 2011-05-23 20:20:52 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:    
Bug Blocks: 570130, 580954    
Attachments:
Description Flags
guest dumpxml none

Comment 1 Daniel Berrangé 2010-04-16 15:04:49 UTC
This libvirt bug actually appears to be a result of the virtio disk/net drivers not providing correct links in sysfs, not associating to the PCI device.

Comment 2 Daniel Berrangé 2010-04-16 15:11:38 UTC
In this example, eth2 is a virtio device and eth3 is an e1000 device, both are PCI devices.

The virtio device (eth2) does not link to its PCI device:

[root@dhcp-0-232 net]# cd /sys/class/net
[root@dhcp-0-232 net]# ls -al eth2 eth3
lrwxrwxrwx. 1 root root 0 Apr 16 16:06 eth2 -> ../../devices/virtio-pci/virtio2/net/eth2
lrwxrwxrwx. 1 root root 0 Apr 16 16:06 eth3 -> ../../devices/pci0000:00/0000:00:06.0/net/eth3
[root@dhcp-0-232 net]# ls -al eth2/device eth3/device
lrwxrwxrwx. 1 root root 0 Apr 16 16:09 eth2/device -> ../../../virtio2
lrwxrwxrwx. 1 root root 0 Apr 16 16:09 eth3/device -> ../../../0000:00:06.0

Comment 4 RHEL Program Management 2010-04-16 16:08:05 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 5 RHEL Program Management 2010-07-15 14:00:11 UTC
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release. It has
been denied for the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **

Comment 8 RHEL Program Management 2010-11-16 09:11:06 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux maintenance release. Product Management has 
requested further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed 
products. This request is not yet committed for inclusion in an Update release.

Comment 10 Michael S. Tsirkin 2011-01-18 10:38:34 UTC
*** Bug 668779 has been marked as a duplicate of this bug. ***

Comment 14 Aristeu Rozanski 2011-02-03 16:19:49 UTC
Patch(es) available on kernel-2.6.32-112.el6

Comment 17 Shirley Zhou 2011-02-15 08:52:20 UTC
Reproduce this bug with kernel-2.6.32-94.el6.x86_64.

run virsh nodedev-list --tree  inside a virtual machine with 3 virtio nics and 3 virtio blk.

#virsh nodedev-list --tree
computer
 |
  +- block_vda
  +- block_vdb
  +- block_vdc
  +- net_eth0_52_54_00_20_10_67
  +- net_eth1_52_54_00_8d_b0_14
  +- net_eth2_52_54_00_5d_1d_74
  +- net_lo_00_00_00_00_00_00
  +- pci_0000_00_00_0
  +- pci_0000_00_01_0
  +- pci_0000_00_01_1
  |   |
  |   +- scsi_host0
  |   +- scsi_host1
  |     
  +- pci_0000_00_01_2
  |   |
  |   +- usb_usb1
  |       |
  |       +- usb_1_0_1_0
  |       +- usb_1_1
  |           |
  |           +- usb_1_1_1_0
  |             
  +- pci_0000_00_01_3
  +- pci_0000_00_02_0
  +- pci_0000_00_03_0
  +- pci_0000_00_04_0
  +- pci_0000_00_05_0
  +- pci_0000_00_06_0
  +- pci_0000_00_07_0
  +- pci_0000_00_08_0
  +- pci_0000_00_09_0
  +- pci_0000_00_0a_0
For result, we can see 3 virtio nics all linked to 'computer' instead of their
respective PCI devices.

Verify this bug with kernel-2.6.32-115.el6.x86_64 as same guest, same configuration.
#virsh nodedev-list --tree 
computer
 |
  +- net_lo_00_00_00_00_00_00
  +- pci_0000_00_00_0
  +- pci_0000_00_01_0
  +- pci_0000_00_01_1
  |   |
  |   +- scsi_host0
  |   +- scsi_host1
  |     
  +- pci_0000_00_01_2
  |   |
  |   +- usb_usb1
  |       |
  |       +- usb_1_0_1_0
  |       +- usb_1_1
  |           |
  |           +- usb_1_1_1_0
  |             
  +- pci_0000_00_01_3
  +- pci_0000_00_02_0
  +- pci_0000_00_03_0
  |   |
  |   +- net_eth0_52_54_00_20_10_67
  |     
  +- pci_0000_00_04_0
  +- pci_0000_00_05_0
  |   |
  |   +- block_vda
  |     
  +- pci_0000_00_06_0
  +- pci_0000_00_07_0
  |   |
  |   +- block_vdb
  |     
  +- pci_0000_00_08_0
  |   |
  |   +- block_vdc
  |     
  +- pci_0000_00_09_0
  |   |
  |   +- net_eth1_52_54_00_8d_b0_14
  |     
  +- pci_0000_00_0a_0
      |
      +- net_eth2_52_54_00_5d_1d_74

We get expected result, so this bug has been resolved.

Attached dumpxml file of this guest for your reference.

Comment 18 Shirley Zhou 2011-02-15 08:53:08 UTC
Created attachment 478796 [details]
guest dumpxml

Comment 19 Miya Chen 2011-02-24 07:51:38 UTC
change status to verified based on comment#17

Comment 20 errata-xmlrpc 2011-05-23 20:20:52 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0542.html