Red Hat Bugzilla – Bug 1029732
Libvirt can not update/modify queues value of interface element using update-device command
Last modified: 2016-04-26 09:45:16 EDT
Description of problem: Libvirt can not update/modify queues value of interface element using update-device command Version-Release number of selected component (if applicable): libvirt-1.1.1-11.el7.x86_64 kernel-3.10.0-33.el7.x86_64 qemu-kvm-1.5.3-10.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. Start a domain with interface and multi-queue enabled [root@sriov2 ~]# virsh start r7 Domain r7 started [root@sriov2 ~]# virsh dumpxml r7 |grep -aA8 interface <interface type='network'> <mac address='52:54:00:02:0a:7a'/> <source network='default'/> <target dev='vnet0'/> <model type='virtio'/> <driver name='vhost' queues='2'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </interface> ... 2.Update the interface queue value using update-device [root@sriov2 ~]# cat nic.xml <interface type='network'> <mac address='52:54:00:02:0a:7a'/> <source network='default'/> <target dev='vnet0'/> <model type='virtio'/> <alias name='net0'/> <driver name='vhost' queues='4'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </interface> [root@sriov2 ~]# [root@sriov2 ~]# virsh update-device r7 nic.xml --current Device updated successfully 3. Check the results [root@sriov2 ~]# virsh dumpxml r7 |grep -aA8 interface <interface type='network'> <mac address='52:54:00:02:0a:7a'/> <source network='default'/> <target dev='vnet0'/> <model type='virtio'/> <driver name='vhost' queues='2'/> <========the value was not updated <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </interface> ... Actual results: As step3 Expected results: If this feature can be supported by update-device cmd, please do action accordingly, if not, I think libvirtd should pop up some error messages to refuse it. For example, we replace the driver(vhost->qemu) using same command: [root@sriov2 ~]# virsh dumpxml r7 | grep -aA8 interface <interface type='network'> <mac address='52:54:00:02:0a:7a'/> <source network='default'/> <target dev='vnet1'/> <model type='virtio'/> <driver name='vhost'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </interface> ... [root@sriov2 ~]# vim nic.xml [root@sriov2 ~]# cat nic.xml <interface type='network'> <mac address='52:54:00:02:0a:7a'/> <source network='default'/> <target dev='vnet1'/> <model type='virtio'/> <driver name='qemu'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </interface> [root@sriov2 ~]# virsh update-device r7 nic.xml --current error: Failed to update device from nic.xml error: Operation not supported: cannot modify virtio network device driver attributes
My understanding is that it *can't* be changed live (i.e. without hot-unplugging the device and plugging in a new device). The plumbing for a macvtap interface is more or less set in stone at the time the device is created. For this reason, I think the only reasonable thing to do here is to log an error if someone tries to make a live change to the number of queues.
Fix pushed upstream: commit 5e12641e0ea49fa1f0b4338f999ec63f41efec4c Author: Laine Stump <laine@laine.org> Date: Tue Dec 3 12:40:38 2013 +0200 qemu: report error on attempt to live change virtio-net queues
Verify it as follows. The result is expected. Version: libvirt-1.2.8-6.el7.x86_64 qemu-kvm-rhev-2.1.2-8.el7.x86_64 qemu-kvm-1.5.3-79.el7.x86_64 Steps: # virsh start rhel7.0 Domain rhel7.0 started # virsh dumpxml rhel7.0 |grep -aA8 interface <interface type='network'> <mac address='52:54:00:db:0c:00'/> <source network='default'/> <target dev='vnet0'/> <model type='virtio'/> <driver name='vhost' queues='2'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> ... # cat nic.xml <interface type='network'> <mac address='52:54:00:db:0c:00'/> <source network='default'/> <target dev='vnet0'/> <model type='virtio'/> <driver name='vhost' queues='4'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> # virsh update-device rhel7.0 nic.xml --current error: Failed to update device from nic.xml error: Operation not supported: cannot modify virtio network device driver attributes
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://rhn.redhat.com/errata/RHSA-2015-0323.html