Description of problem: vhostuser type interface do not support bandwidth, but no warning message Version-Release number of selected component (if applicable): libvirt-3.9.0-5.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. set log level as 1 in libvirtd.conf log_level = 1 log_outputs="1:file:/var/log/libvirt/libvirtd.log" # systemctl restart libvirtd 2. start a guest with vhostuser type interface with bandwidth defined # virsh edit rhel ... <interface type='vhostuser'> <mac address='52:54:00:3b:83:1b'/> <source type='unix' path='/var/run/openvswitch/vhost-user1' mode='client'/> <bandwidth> <inbound average='1000' peak='5000' burst='1024'/> <outbound average='128' peak='256' burst='256'/> </bandwidth> <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/> </interface> ... # virsh start rhel Domain rhel started # virsh dumpxml rhel | grep /interface -B12 .. <interface type='vhostuser'> <mac address='52:54:00:3b:83:1b'/> <source type='unix' path='/var/run/openvswitch/vhost-user1' mode='client'/> <bandwidth> <inbound average='1000' peak='5000' burst='1024'/> <outbound average='128' peak='256' burst='256'/> </bandwidth> <target dev='vhost-user1'/> <model type='virtio'/> <alias name='net3'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/> </interface> 3. check the libvirtd.log for warning # cat /var/log/libvirt/libvirtd.log | grep warning ==> nothing 4. check for user type # cat user.xml <interface type='user'> <bandwidth> <inbound average='1000' peak='5000' burst='1024'/> <outbound average='128' peak='256' burst='256'/> </bandwidth> </interface> # virsh attach-device rhel user.xml Device attached successfully # cat /var/log/libvirt/libvirtd.log | grep warning 2017-12-10 12:58:42.992+0000: 27131: warning : qemuDomainAttachNetDevice:1000 : setting bandwidth on interfaces of type 'user' is not implemented yet Actual results: vhostuser type interface do not support bandwidth, but no warning message Expected results: there should be warning message for vhostuser with bandwidth setting Additional info:
Patch proposed upstream: https://www.redhat.com/archives/libvir-list/2018-October/msg01366.html
Fixed upstream: commit 4de4e4bc991158ea2a881d4729a668b2eb5fe83a Author: Michal Privoznik <mprivozn> Date: Thu Nov 1 18:21:12 2018 +0100 qemu: Dissolve qemuBuildVhostuserCommandLine in qemuBuildInterfaceCommandLine https://bugzilla.redhat.com/show_bug.cgi?id=1524230 The qemuBuildVhostuserCommandLine builds command line for vhostuser type interfaces. It is duplicating some code of the function it is called from (qemuBuildInterfaceCommandLine) because of the way it's called. If we merge it into the caller not only we save a few lines but we also enable checks that we would have to duplicate otherwise (e.g. QoS availability). Signed-off-by: Michal Privoznik <mprivozn> Reviewed-by: Erik Skultety <eskultet> v4.10.0-rc1~147
Test on upstream libvirt-5.1.0-1.el7.x86_64, it works as expected. Start a guest with vhostuser configured with bandwidth, there will be warning message in the log. # virsh dumpxml rhel77 | grep /interface -B12 <interface type='vhostuser'> <mac address='52:54:00:93:51:dd'/> <source type='unix' path='/var/run/openvswitch/vhost-user2' mode='client'/> <bandwidth> <inbound average='1000' peak='5000' burst='1024'/> <outbound average='128' peak='256' burst='256'/> </bandwidth> <target dev='vhost-user2'/> <model type='virtio'/> <driver queues='4'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> # cat /var/log/libvirt/libvirtd.log | grep warning 2019-02-26 05:23:54.489+0000: 42438: warning : qemuBuildInterfaceCommandLine:8785 : setting bandwidth on interfaces of type 'vhostuser' is not implemented yet
Test on libvirt-5.0.0-11.module+el8.0.1+3459+e357ef2f.x86_64, the bug is fixed. # virsh dumpxml rh | grep /interface -B9 <interface type='vhostuser'> <mac address='52:54:00:93:51:db'/> <source type='unix' path='/var/run/openvswitch/vhost-user1' mode='client'/> <bandwidth> <inbound average='1000' peak='5000' burst='1024'/> <outbound average='128' peak='256' burst='256'/> </bandwidth> <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </interface> # virsh start rh Domain rh started # cat /var/log/libvirt/libvirtd.log | grep warning ... 2019-07-09 03:42:42.599+0000: 8227: warning : qemuBuildInterfaceCommandLine:8885 : setting bandwidth on interfaces of type 'vhostuser' is not implemented yet ...
This was verified and shipped long ago. Closing the bug report.