RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1029732 - Libvirt can not update/modify queues value of interface element using update-device command
Summary: Libvirt can not update/modify queues value of interface element using update-...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Laine Stump
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-13 03:16 UTC by Hu Jianwei
Modified: 2022-04-20 08:59 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.2.7-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 07:25:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

Description Hu Jianwei 2013-11-13 03:16:42 UTC
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 11:36:40 UTC
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 14:53:07 UTC
Fix pushed upstream:

commit 5e12641e0ea49fa1f0b4338f999ec63f41efec4c
Author: Laine Stump <laine>
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 09:50:19 UTC
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 07:25:49 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, 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

Comment 10 qiufossen 2022-04-20 08:59:38 UTC
The domain is at running, can not update virtio-net queues living. The libvirt code as following:

  if (virDomainNetIsVirtioModel(olddev) &&
        (olddev->driver.virtio.name != newdev->driver.virtio.name ||
         olddev->driver.virtio.txmode != newdev->driver.virtio.txmode ||
         olddev->driver.virtio.ioeventfd != newdev->driver.virtio.ioeventfd ||
         olddev->driver.virtio.event_idx != newdev->driver.virtio.event_idx ||

         olddev->driver.virtio.queues != newdev->driver.virtio.queues ||

         olddev->driver.virtio.rx_queue_size != newdev->driver.virtio.rx_queue_size ||
         olddev->driver.virtio.tx_queue_size != newdev->driver.virtio.tx_queue_size ||
         olddev->driver.virtio.host.csum != newdev->driver.virtio.host.csum ||
         olddev->driver.virtio.host.gso != newdev->driver.virtio.host.gso ||
         olddev->driver.virtio.host.tso4 != newdev->driver.virtio.host.tso4 ||
         olddev->driver.virtio.host.tso6 != newdev->driver.virtio.host.tso6 ||
         olddev->driver.virtio.host.ecn != newdev->driver.virtio.host.ecn ||
         olddev->driver.virtio.host.ufo != newdev->driver.virtio.host.ufo ||
         olddev->driver.virtio.host.mrg_rxbuf != newdev->driver.virtio.host.mrg_rxbuf ||
         olddev->driver.virtio.guest.csum != newdev->driver.virtio.guest.csum ||
         olddev->driver.virtio.guest.tso4 != newdev->driver.virtio.guest.tso4 ||
         olddev->driver.virtio.guest.tso6 != newdev->driver.virtio.guest.tso6 ||
         olddev->driver.virtio.guest.ecn != newdev->driver.virtio.guest.ecn ||
         olddev->driver.virtio.guest.ufo != newdev->driver.virtio.guest.ufo)) {
        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                       _("cannot modify virtio network device driver attributes"));
        goto cleanup;


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