Bug 1972991 - Hotplugging a hostdev type interface succeeds, but the live xml is not updated accordingly
Summary: Hotplugging a hostdev type interface succeeds, but the live xml is not update...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: ---
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.5
Assignee: Laine Stump
QA Contact: yalzhang@redhat.com
URL:
Whiteboard:
Depends On: 1972468
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-17 03:24 UTC by yalzhang@redhat.com
Modified: 2021-11-16 08:50 UTC (History)
6 users (show)

Fixed In Version: libvirt-7.5.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1972468
Environment:
Last Closed: 2021-11-16 07:54:24 UTC
Type: Bug
Target Upstream Version: 7.5.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:4684 0 None None None 2021-11-16 07:55:16 UTC

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


Note You need to log in before you can comment on or make changes to this bug.