Bug 1919619 - Live update the interface to delete the Qos setting will crash the libvirtd
Summary: Live update the interface to delete the Qos setting will crash the libvirtd
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.4
Hardware: All
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.4
Assignee: Michal Privoznik
QA Contact: yalzhang@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1947720
TreeView+ depends on / blocked
 
Reported: 2021-01-24 05:45 UTC by yalzhang@redhat.com
Modified: 2021-05-25 06:48 UTC (History)
5 users (show)

Fixed In Version: libvirt-7.0.0-4.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1947720 (view as bug list)
Environment:
Last Closed: 2021-05-25 06:47:24 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description yalzhang@redhat.com 2021-01-24 05:45:55 UTC
Description of problem:
Live update the interface to delete the Qos setting will crash the libvirtd

Version-Release number of selected component (if applicable):
libvirt-7.0.0-2.module+el8.4.0+9520+ef609c5f.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Start a vm with interface set with Qos setting as below:
[root@host]# virsh dumpxml test | grep /interface -B11    <interface type='network'>
      <mac address='52:54:00:58:ff:ab'/>
      <source network='default' portid='436047ca-70e6-4afa-927a-2707016c33ba' bridge='virbr0'/>
      <bandwidth>
        <inbound average='2000' peak='3000' burst='2048'/>
        <outbound average='256' peak='512' burst='512'/>
      </bandwidth>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

2. dump the xml into a file as net.xml, and delete the Qos setting:
[root@host]# cat net.xml
<interface type='network'>
      <mac address='52:54:00:58:ff:ab'/>
      <source network='default' portid='3f9058c0-6f83-4dc7-adde-47d9bff8337f' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

3. use above xml to live update the vm xml to delete the Qos setting in the interface, it will crash the libvirt daemon:
[root@host]# pidof libvirtd 
1444010
[root@host]# virsh list --all
 Id   Name             State
---------------------------------
 1    test             running

[root@host]# virsh update-device test net.xml
error: Disconnected from qemu:///system due to end of file
error: Failed to update device from net.xml
error: End of file while reading data: Input/output error

[root@host]# pidof libvirtd 
1444119

Actual results:
Live update the interface to delete the Qos setting will crash the libvirtd daemon

Expected results:
The libvirtd should not crash

Additional info:
No issue when clear the Qos setting by  "# virsh domiftune test vnet0"

Comment 1 Han Han 2021-01-25 01:26:23 UTC
pls provide the backtrace of the coredump

Comment 3 yalzhang@redhat.com 2021-01-29 07:03:19 UTC
attach the backtrace here:

(gdb) c
Continuing.
[Detaching after fork from child process 63962]
[Detaching after fork from child process 63963]

Thread 5 "rpc-worker" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fc68b436700 (LWP 63843)]
qemuDomainChangeNet (driver=driver@entry=0x7fc638138130, vm=vm@entry=0x55870316b6a0, dev=dev@entry=0x7fc680009750) at ../src/qemu/qemu_hotplug.c:3900
3900	            if (!newb->in || newb->in->average == 0)
(gdb) c
Continuing.
Couldn't get registers: No such process.
Couldn't get registers: No such process.
(gdb) [Thread 0x7fc623fff700 (LWP 63920) exited]
[Thread 0x7fc64affd700 (LWP 63908) exited]
[Thread 0x7fc64b7fe700 (LWP 63857) exited]
[Thread 0x7fc65096e700 (LWP 63856) exited]
[Thread 0x7fc64bfff700 (LWP 63854) exited]
[Thread 0x7fc652af5700 (LWP 63853) exited]
[Thread 0x7fc6532f6700 (LWP 63852) exited]
[Thread 0x7fc660ac9700 (LWP 63851) exited]
[Thread 0x7fc6612ca700 (LWP 63850) exited]
[Thread 0x7fc690c31700 (LWP 63849) exited]
[Thread 0x7fc691432700 (LWP 63848) exited]
[Thread 0x7fc691c33700 (LWP 63847) exited]
[Thread 0x7fc692434700 (LWP 63846) exited]
[Thread 0x7fc692c35700 (LWP 63845) exited]
[Thread 0x7fc693436700 (LWP 63844) exited]
[Thread 0x7fc68b436700 (LWP 63843) exited]
[Thread 0x7fc693c37700 (LWP 63842) exited]
[Thread 0x7fc694438700 (LWP 63841) exited]
[Thread 0x7fc694c39700 (LWP 63840) exited]

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.

Comment 4 smitterl 2021-02-03 11:27:53 UTC
I'm setting HW All as I can reproduce this with

libvirt-7.0.0-3.module+el8.4.0+9709+a99efd61.s390x
qemu-kvm-5.2.0-4.module+el8.4.0+9676+589043b9.s390x

For me this also hit the automated test - virtual_network.iface_network.qos_test.qos_option_bandwidth.by_update_device

Comment 5 Michal Privoznik 2021-02-15 18:00:42 UTC
Patch proposed upstream:

https://listman.redhat.com/archives/libvir-list/2021-February/msg00851.html

Comment 6 Michal Privoznik 2021-02-16 08:07:40 UTC
Merged upstream as:

a1229335f6 qemu_hotplug: Don't dereference NULL pointer @newb in qemuDomainChangeNet()

v7.0.0-463-ga1229335f6

Comment 11 yalzhang@redhat.com 2021-02-22 05:35:14 UTC
Test on libvirt-7.0.0-4.module+el8.4.0+10093+e085f1eb.x86_64, the result is as expected, set the bug to be verified. Test scenarios includes:
1. Add Qos setting by update-device;
2. delete the Qos setting by update-device;
3. update Qos setting by update-device;
4. test with virsh cmd "domiftune" for above scenarios, all the result is as expected.

Comment 13 errata-xmlrpc 2021-05-25 06:47: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:2098


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