Bug 1029732 - Libvirt can not update/modify queues value of interface element using update-device command
Libvirt can not update/modify queues value of interface element using update-...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Laine Stump
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-12 22:16 EST by Hu Jianwei
Modified: 2016-04-26 09:45 EDT (History)
5 users (show)

See Also:
Fixed In Version: libvirt-1.2.7-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 02:25:49 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Hu Jianwei 2013-11-12 22:16:42 EST
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
Comment 2 Laine Stump 2013-11-15 06:36:40 EST
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.
Comment 3 Laine Stump 2013-12-03 09:53:07 EST
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
Comment 7 lcheng 2014-11-17 04:50:19 EST
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
Comment 9 errata-xmlrpc 2015-03-05 02:25:49 EST
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

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