Bug 1751580
Summary: | The connection of hostdev network do not decrease after detach interface | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | yalzhang <yalzhang> |
Component: | libvirt | Assignee: | Daniel Berrangé <berrange> |
Status: | CLOSED ERRATA | QA Contact: | jiyan <jiyan> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 8.1 | CC: | berrange, jdenemar, lmen, xuzhang |
Target Milestone: | rc | Keywords: | Regression |
Target Release: | 8.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-5.9.0-1.el8 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-05-05 09:49:41 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: | |||
Bug Depends On: | |||
Bug Blocks: | 1585087 |
Description
yalzhang@redhat.com
2019-09-12 08:09:37 UTC
I've bisected this issue back to the following commit: commit bbe2aa627f621e6749af374b22856184d1f351dc (refs/bisect/bad) Author: Daniel P. Berrangé <berrange> Date: Thu Jul 26 17:24:30 2018 +0100 conf: simplify link from hostdev back to network device hostdevs have a link back to the original network device. This is fairly generic accepting any type of device, however, we don't intend to make use of this approach in future. It can thus be specialized to network devices. Reviewed-by: Cole Robinson <crobinso> Signed-off-by: Daniel P. Berrangé <berrange> which is rather annoying as AFAICT this commit has no functional change, but clearly it does break the counting somehow. Patch proposed upstream https://www.redhat.com/archives/libvir-list/2019-September/msg00523.html Fix merged upstream commit b9ed82c9fba30666428f482b4830a26ffb0a4f52 Author: Daniel P. Berrangé <berrange> Date: Fri Sep 13 13:41:29 2019 +0100 qemu: fix detach of hostdev based network interface This fixes bug in commit bbe2aa627f621e6749af374b22856184d1f351dc Author: Daniel P. Berrangé <berrange> Date: Thu Jul 26 17:24:30 2018 +0100 conf: simplify link from hostdev back to network device hostdevs have a link back to the original network device. This is fairly generic accepting any type of device, however, we don't intend to make use of this approach in future. It can thus be specialized to network devices. Reviewed-by: Cole Robinson <crobinso> Signed-off-by: Daniel P. Berrangé <berrange> which mistakenly deleted the assignment to the 'net' variable, which meant we never invoked the network driver release callback Reviewed-by: Michal Privoznik <mprivozn> Signed-off-by: Daniel P. Berrangé <berrange> Reproduce this issue with libvirt-5.9.0-1.module+el8.2.0+4682+acceb91e.x86_64. Version: libvirt-5.9.0-1.module+el8.2.0+4682+acceb91e.x86_64 qemu-kvm-4.1.0-14.module+el8.2.0+4673+ff4b3b61.x86_64 kernel-4.18.0-171.el8.x86_64 Steps: 1. Set up the vfs and create virtual network using the vfs # echo 5 > /sys/devices/pci0000:80/0000:80:02.0/0000:82:00.1/sriov_numvfs # virsh nodedev-dumpxml pci_0000_82_00_1 <device> <name>pci_0000_82_00_1</name> <path>/sys/devices/pci0000:80/0000:80:02.0/0000:82:00.1</path> <parent>pci_0000_80_02_0</parent> <driver> <name>ixgbe</name> </driver> <capability type='pci'> <class>0x020000</class> <domain>0</domain> <bus>130</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='0x82' slot='0x10' function='0x1'/> <address domain='0x0000' bus='0x82' slot='0x10' function='0x3'/> <address domain='0x0000' bus='0x82' slot='0x10' function='0x5'/> <address domain='0x0000' bus='0x82' slot='0x10' function='0x7'/> <address domain='0x0000' bus='0x82' slot='0x11' function='0x1'/> </capability> <iommuGroup number='42'> <address domain='0x0000' bus='0x82' slot='0x00' function='0x1'/> </iommuGroup> <numa node='1'/> <pci-express> <link validity='cap' port='0' speed='5' width='8'/> <link validity='sta' speed='5' width='8'/> </pci-express> </capability> </device> # cat network.xml <network> <name>pt2</name> <forward mode='hostdev'> <driver name='vfio' managed="yes"/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x1'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x3'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x5'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x7'/> </forward> </network> # virsh net-dumpxml pt2 <network> <name>pt2</name> <uuid>6ee6f4f6-c89f-4dd8-9f0f-5ade13fd4c47</uuid> <forward mode='hostdev' managed='yes'> <driver name='vfio'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x1'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x3'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x5'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x7'/> </forward> </network> 2. Cold-plug interface to VM using the virtual network above # virsh domstate test82 shut off # virsh attach-interface test82 --type network --source pt2 --config Interface attached successfully # virsh attach-interface test82 --type network --source pt2 --config Interface attached successfully # virsh dumpxml test82 --inactive |grep "<interface" -A7 <interface type='network'> <mac address='52:54:00:f7:73:1c'/> <source network='pt2'/> <model type='rtl8139'/> <address type='pci' domain='0x0000' bus='0x0b' slot='0x01' function='0x0'/> </interface> <interface type='network'> <mac address='52:54:00:84:41:a4'/> <source network='pt2'/> <model type='rtl8139'/> <address type='pci' domain='0x0000' bus='0x0b' slot='0x02' function='0x0'/> </interface> 3. Start the VM and check the "domiflist" and "net-dumpxml" # virsh start test82 Domain test82 started # virsh domiflist test82 Interface Type Source Model MAC ------------------------------------------------------------- vnet0 bridge virbr0 virtio 52:54:00:23:b7:cd - hostdev - rtl8139 52:54:00:f7:73:1c - hostdev - rtl8139 52:54:00:84:41:a4 # virsh net-dumpxml pt2 <network connections='2'> <name>pt2</name> <uuid>6ee6f4f6-c89f-4dd8-9f0f-5ade13fd4c47</uuid> <forward mode='hostdev' managed='yes'> <driver name='vfio'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x1'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x3'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x5'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x7'/> </forward> </network> 4. Detach a interface from the VM and check the "domiflist" and "net-dumpxml" again # virsh detach-interface test82 --mac 52:54:00:84:41:a4 --type hostdev Interface detached successfully # virsh domiflist test82 Interface Type Source Model MAC ------------------------------------------------------------- vnet0 bridge virbr0 virtio 52:54:00:23:b7:cd - hostdev - rtl8139 52:54:00:f7:73:1c # virsh net-dumpxml pt2 <network connections='1'> <name>pt2</name> <uuid>6ee6f4f6-c89f-4dd8-9f0f-5ade13fd4c47</uuid> <forward mode='hostdev' managed='yes'> <driver name='vfio'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x1'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x3'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x5'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x7'/> </forward> </network> 5. Destroy the VM and check the "net-dumpxml" again # virsh destroy test82 Domain test82 destroyed # virsh net-dumpxml pt2 <network> <name>pt2</name> <uuid>6ee6f4f6-c89f-4dd8-9f0f-5ade13fd4c47</uuid> <forward mode='hostdev' managed='yes'> <driver name='vfio'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x1'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x3'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x5'/> <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x7'/> </forward> </network> All the results are as expected, move this bug to be verified. Update the typo in last comment, Verified this bug with libvirt-5.9.0-1.module+el8.2.0+4682+acceb91e.x86_64. 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/RHBA-2020:2017 |