Bug 1318192

Summary: The interface info disappears from the dumpxml of the guest when manually unbind the vf pci device on host
Product: Red Hat Enterprise Linux 7 Reporter: Jingjing Shao <jishao>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: dyuan, jdenemar, jishao, mzhan, rbalakri, shyu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-17 08:45:33 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:

Description Jingjing Shao 2016-03-16 09:08:47 UTC
Description of problem:
The interface info disappears from the dumpxml of the guest when manually unbind the vf pci device on host

PKG
OS-rhel7.2
libvirt-1.3.2-1.el7.x86_64


How reproducible:
100%

Setup

Steps to Reproduce:

1.[root@ibm-x3850x5-05 ~]# lspci | grep 82599
86:00.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01)
86:00.1 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01)
86:10.0 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01)
86:10.1 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01)
86:10.2 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01)
86:10.3 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01)


2.[root@ibm-x3850x5-05 ~]# virsh nodedev-dumpxml pci_0000_86_00_0
<device>
  <name>pci_0000_86_00_0</name>
  <path>/sys/devices/pci0000:80/0000:80:01.0/0000:86:00.0</path>
  <parent>pci_0000_80_01_0</parent>
  <driver>
    <name>ixgbe</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>134</bus>
    <slot>0</slot>
    <function>0</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='0x86' slot='0x10' function='0x0'/>
      <address domain='0x0000' bus='0x86' slot='0x10' function='0x2'/>
      <address domain='0x0000' bus='0x86' slot='0x10' function='0x4'/>
      <address domain='0x0000' bus='0x86' slot='0x10' function='0x6'/>
    </capability>
    <iommuGroup number='27'>
      <address domain='0x0000' bus='0x86' slot='0x00' function='0x0'/>
    </iommuGroup>
    <numa node='1'/>
    <pci-express>
      <link validity='cap' port='0' speed='5' width='8'/>
      <link validity='sta' speed='5' width='4'/>
    </pci-express>
  </capability>
</device>

3.add the information to the guest r7 xml, then start r7
    <interface type='hostdev' managed='yes'>
      <mac address='52:54:00:62:9d:13'/>
      <driver name='vfio'/>
      <source>
        <address type='pci' domain='0x0000' bus='0x86' slot='0x10' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

[root@ibm-x3850x5-05 images]# virsh start r7
Domain r7 started

[root@ibm-x3850x5-05 images]# virsh dumpxml r7 | grep hostdev -A8 -i
    <interface type='hostdev' managed='yes'>
      <mac address='52:54:00:62:9d:13'/>
      <driver name='vfio'/>
      <source>
        <address type='pci' domain='0x0000' bus='0x86' slot='0x10' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

4.get into the guest r7
[root@localhost ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::5054:ff:fe62:9d13  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:62:9d:13  txqueuelen 1000  (Ethernet)
        RX packets 14  bytes 840 (840.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5  bytes 438 (438.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
.....

[root@localhost ~]# ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000
    link/ether 52:54:00:62:9d:13 brd ff:ff:ff:ff:ff:ff
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT
    link/ether 52:54:00:90:a7:02 brd ff:ff:ff:ff:ff:ff
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN mode DEFAULT qlen 500
    link/ether 52:54:00:90:a7:02 brd ff:ff:ff:ff:ff:ff



5.on the host
[root@ibm-x3850x5-05 ~]# echo "0000:86:10.0" > /sys/bus/pci/devices/0000\:86\:10.0/driver/unbind

6.On the guest
[root@localhost ~]# ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
.....

[root@localhost ~]# ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT
    link/ether 52:54:00:90:a7:02 brd ff:ff:ff:ff:ff:ff
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN mode DEFAULT qlen 500
    link/ether 52:54:00:90:a7:02 brd ff:ff:ff:ff:ff:ff


7.On the host
[root@ibm-x3850x5-05 ~]# virsh dumpxml r7 | grep hostdev -A8 -i
[root@ibm-x3850x5-05 ~]#
[root@ibm-x3850x5-05 ~]#
[root@ibm-x3850x5-05 ~]#



Expected results:
Manually unbind the vf pci device, in step7  the interface info  should not disappear from the dumpxml of the guest r7


Additional info:
N/A

Comment 2 Jiri Denemark 2016-03-17 08:45:33 UTC
> 5.on the host
> [root@ibm-x3850x5-05 ~]# echo "0000:86:10.0" > /sys/bus/pci/devices/0000\:86\:10.0/driver/unbind

Just don't do that.