Description of problem: libvirtd crashed after setting domiftune outbound value Version-Release number of selected component (if applicable): libvirt-6.0.0-4.module+el8.2.0+5642+838f3513.x86_64qemu-kvm-4.2.0-8.module+el8.2.0+5607+dc756904.x86_64 How reproducible: 100% Steps to Reproduce: 1. check the process id of libvirtd # pidof libvirtd 17568 2. check the interface xml of guest # virsh dumpxml rhel8.2 |grep '<interface' -A7 <interface type='network'> <mac address='52:54:00:37:36:25'/> <source network='default' portid='e7987028-8808-4884-ab4f-79efa98446cf' bridge='virbr0'/> <target dev='vnet0'/> <model type='virtio'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </interface> 3. set the outbound value of the above interface # virsh domiftune rhel8.2 vnet0 --outbound 4294968 error: Disconnected from qemu:///system due to end of file error: Unable to set interface parameters error: End of file while reading data: Input/output error 4. check the process id of libvirtd again # pidof libvirtd 17709 5. check the backtrace (gdb) bt #0 virDomainNetBandwidthToTypedParams (bandwidth=0x0, bandwidth=0x0, nparams=0x7f6d99e71658, params=0x7f6d99e71660) at ../../src/conf/domain_conf.c:31070 #1 virDomainNetBandwidthUpdate (iface=iface@entry=0x7f6d4819b6a0, newBandwidth=0x0) at ../../src/conf/domain_conf.c:31070 #2 0x00007f6d63721fb5 in qemuDomainSetInterfaceParameters (dom=<optimized out>, device=0x7f6d8c004960 "vnet0", params=<optimized out>, nparams=<optimized out>, flags=<optimized out>) at ../../src/qemu/qemu_driver.c:11649 #3 0x00007f6dad46adae in virDomainSetInterfaceParameters (domain=domain@entry=0x7f6d8c004ac0, device=0x7f6d8c004960 "vnet0", params=<optimized out>, nparams=1, flags=0) at ../../src/libvirt-domain.c:5611 #4 0x0000558c9db4801c in remoteDispatchDomainSetInterfaceParameters (server=0x558c9e0841e0, msg=0x558c9e0d0670, args=0x7f6d8c004980, rerr=0x7f6d99e718e0, client=<optimized out>) at ./remote/remote_daemon_dispatch_stubs.h:10799 #5 remoteDispatchDomainSetInterfaceParametersHelper (server=0x558c9e0841e0, client=<optimized out>, msg=0x558c9e0d0670, rerr=0x7f6d99e718e0, args=0x7f6d8c004980, ret=0x0) at ./remote/remote_daemon_dispatch_stubs.h:10769 #6 0x00007f6dad3a5099 in virNetServerProgramDispatchCall (msg=0x558c9e0d0670, client=0x558c9e0d0490, server=0x558c9e0841e0, prog=0x558c9e0c2110) at ../../src/rpc/virnetserverprogram.c:430 #7 virNetServerProgramDispatch (prog=0x558c9e0c2110, server=server@entry=0x558c9e0841e0, client=0x558c9e0d0490, msg=0x558c9e0d0670) at ../../src/rpc/virnetserverprogram.c:302 #8 0x00007f6dad3aa25c in virNetServerProcessMsg (msg=<optimized out>, prog=<optimized out>, client=<optimized out>, srv=0x558c9e0841e0) at ../../src/rpc/virnetserver.c:136 #9 virNetServerHandleJob (jobOpaque=<optimized out>, opaque=0x558c9e0841e0) at ../../src/rpc/virnetserver.c:153 #10 0x00007f6dad2c77f0 in virThreadPoolWorker (opaque=opaque@entry=0x558c9e069b30) at ../../src/util/virthreadpool.c:163 #11 0x00007f6dad2c6b7c in virThreadHelper (data=<optimized out>) at ../../src/util/virthread.c:196 #12 0x00007f6da966f2de in start_thread (arg=<optimized out>) at pthread_create.c:486 #13 0x00007f6da93a0e83 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Actual results: libvirtd crash Expected results: libvirtd did not crash Additional info: when set the interface outbound with a legal value firstly, then set the outbound value to 4294968, libvirtd will not crash # virsh domiftune rhel8.2 vnet0 --outbound 4294967 # virsh domiftune rhel8.2 vnet0 --outbound 4294968 error: Unable to set interface parameters error: An error occurred, but the cause is unknown
Upstream patches: https://www.redhat.com/archives/libvir-list/2020-February/msg00328.html
Fixed upstream: commit 457b0e74888f61b759e334d91479c258663835d5 Author: Ján Tomko <jtomko> CommitDate: 2020-02-10 16:41:52 +0100 qemu: preserve error on bandwidth rollback We call APIs that reset the error in the rollback code. Preserve the error from the original call that failed. This turns the boringly cryptic: error: Unable to set interface parameters error: An error occurred, but the cause is unknown to the unexpectedly anarchist: error: internal error: Child process (/usr/sbin/tc filter add dev vnet1 parent ffff: protocol all u32 match u32 0 0 police rate 4294968kbps burst 4294968kb mtu 64kb drop flowid :1) unexpected exit status 1: Illegal "rate" Illegal "police" Signed-off-by: Ján Tomko <jtomko> Fixes: f02e21cb3379a41cd42f2d8116f2d10dabace83b https://bugzilla.redhat.com/show_bug.cgi?id=1800505 Reviewed-by: Daniel Henrique Barboza <danielhb413> commit bd622e2a211aad449b54683e2ebd5e980418dd7c Author: Ján Tomko <jtomko> CommitDate: 2020-02-10 16:41:51 +0100 qemu: do not revert to NULL bandwidth Otherwise an attempt to set an invalid value: virsh domiftune rhel8.2 vnet0 --outbound 4294968 on an interface with no bandwidth set crashes. Signed-off-by: Ján Tomko <jtomko> Fixes: f02e21cb3379a41cd42f2d8116f2d10dabace83b https://bugzilla.redhat.com/show_bug.cgi?id=1800505 Reviewed-by: Daniel Henrique Barboza <danielhb413> git describe: v6.0.0-335-g457b0e7488
Verify this bug with libvirt-daemon-6.0.0-10.module+el8.2.0+5984+dce93708.x86_64: 1. prepare a running guest have a vNIC use default network # virsh dumpxml vm1 <interface type='network'> <mac address='52:54:00:18:0b:27'/> <source network='default' portid='9067d922-cdbd-4f2e-9feb-c680c8914f99' bridge='virbr0'/> <target dev='vnet0'/> <model type='rtl8139'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> </interface> 2. set outbound value out of range and get a clearly error from tc command output # virsh domiftune vm1 vnet0 --outbound 4294968 error: Unable to set interface parameters error: internal error: Child process (tc filter add dev vnet0 parent ffff: protocol all u32 match u32 0 0 police rate 4294968kbps burst 4294968kb mtu 64kb drop flowid :1) unexpected exit status 1: Illegal "rate" Illegal "police" 3. check libvirtd status, there is no crash
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