Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1972991

Summary: Hotplugging a hostdev type interface succeeds, but the live xml is not updated accordingly
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: yalzhang <yalzhang>
Component: libvirtAssignee: Laine Stump <laine>
Status: CLOSED ERRATA QA Contact: yalzhang <yalzhang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: ---CC: fjin, jdenemar, jtomko, laine, virt-maint, xuzhang
Target Milestone: rcKeywords: Regression
Target Release: 8.5Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-7.5.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1972468 Environment:
Last Closed: 2021-11-16 07:54:24 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: 7.5.0
Embargoed:
Bug Depends On: 1972468    
Bug Blocks:    

Description yalzhang@redhat.com 2021-06-17 03:24:59 UTC
+++ This bug was initially created as a clone of Bug #1972468 +++

Description of problem:
Hotplug hostev type interface succeed, but the live xml did not update accordingly

Version-Release number of selected component (if applicable):
libvirt-7.4.0-1.module+el8.5.0+11218+83343022.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Start a vm, then try to hotplug an hostdev interface, succeed:
# virsh start rhel
Domain 'rhel' started

# virsh domiflist rhel
 Interface   Type      Source    Model    MAC
-------------------------------------------------------------
 vnet0       network   default   e1000e   52:54:00:5d:da:04

# lspci | grep Virtual
82:10.0 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01)

# virsh attach-interface rhel hostdev --managed 0000:82:10.0
Interface attached successfully

2. Check on the vm, the interface attached successfully:
[root@localhost ~]# ip l
......
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 52:54:00:5d:da:04 brd ff:ff:ff:ff:ff:ff
3: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 52:54:00:df:a2:14 brd ff:ff:ff:ff:ff:ff

3. check the live xml, the hostdev interface do not exists, and domiflist did not show the hostdev interface:
# virsh domiflist rhel
 Interface   Type      Source    Model    MAC
-------------------------------------------------------------
 vnet0       network   default   e1000e   52:54:00:5d:da:04

# virsh dumpxml rhel | grep hostdev
(no outputs)

Actual results:
in step 3, no hostdev interface exists in the live xml after hotplug

Expected results:
The hostdev interface xml should exists in the vm's live xml

Additional info:
on such issue with libvirt-7.3.0-1.module+el8.5.0+11004+f4810536.x86_64

Comment 1 Laine Stump 2021-06-17 05:12:32 UTC
Sigh. :-( Yes, I reproduced it with upstream libvirt on F33, and I see the problem - it was caused by me. Specifically it was upstream commit 7b8bec4560 which was part of the fix for Bug 1939776. That means that the fix for this regression will need to also be backported to RHEL-AV 8.5.0.

Comment 2 Laine Stump 2021-06-17 05:37:44 UTC
Patch posted upstream:

https://listman.redhat.com/archives/libvir-list/2021-June/msg00511.html

Comment 3 Laine Stump 2021-06-18 23:11:45 UTC
This is now pushed upstream:

commit 54b602019d7dfa94a6c52ef7aa3abdfaa93ed233
Author: Laine Stump <laine>
Date:   Thu Jun 17 01:14:27 2021 -0400

    qemu_hotplug: don't forget to add hostdev interfaces to the interface list

Comment 6 yalzhang@redhat.com 2021-07-05 01:20:23 UTC
Test on libvirt-7.5.0-1.module+el8.5.0+11664+59f87560.x86_64, the bug is fixed.
# virsh start rhel 
virshDomain 'rhel' started

# virsh attach-interface rhel hostdev --managed 0000:04:10.6 
Interface attached successfully

# virsh domiflist rhel 
 Interface   Type      Source   Model   MAC
-----------------------------------------------------------
 -           hostdev   -        -       52:54:00:49:1f:a4

# virsh dumpxml rhel | grep /interface -B12
    <interface type='hostdev' managed='yes'>
      <mac address='52:54:00:49:1f:a4'/>
      <driver name='vfio'/>
      <source>
        <address type='pci' domain='0x0000' bus='0x04' slot='0x10' function='0x6'/>
      </source>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

Comment 10 yalzhang@redhat.com 2021-07-12 13:12:14 UTC
Finished one round auto job, no such failures, the bug is fixed.

Comment 12 errata-xmlrpc 2021-11-16 07:54:24 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 (virt:av bug fix and enhancement update), 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-2021:4684