Bug 1484230

Summary: update-device can not update the tx_queue_size or rx_queue_size in interface section while the command report successfully
Product: Red Hat Enterprise Linux 7 Reporter: yalzhang <yalzhang>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED ERRATA QA Contact: yalzhang <yalzhang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: chhu, rbalakri, xuzhang
Target Milestone: rcKeywords: Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-3.7.0-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 10:55:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description yalzhang@redhat.com 2017-08-23 05:08:03 UTC
Description of problem:
update-device can not update the tx_queue_size or rx_queue_size in interface section while the command report successfully updated

Version-Release number of selected component (if applicable):
libvirt-3.2.0-14.el7_4.3.x86_64

How reproducible:
100%

Steps to Reproduce:
1. start a guest with tx_queue_size and rx_queue_size setting in interface section
# virsh dumpxml rhel7.4 | grep /interface -B7
    <interface type='vhostuser'>
      <mac address='52:54:00:93:51:db'/>
      <source type='unix' path='/var/run/openvswitch/vhost-user1' mode='client'/>
      <model type='virtio'/>
      <driver name='vhost' queues='5' rx_queue_size='1024' tx_queue_size='512'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

2. update the tx_queue_size and rx_queue_size by update-device
# cat inter.xml
   <interface type='vhostuser'>
      <mac address='52:54:00:93:51:db'/>
      <source type='unix' path='/var/run/openvswitch/vhost-user1' mode='client'/>
      <model type='virtio'/>
      <driver name='vhost' queues='5' rx_queue_size='256' tx_queue_size='256'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

# virsh update-device rhel7.4 inter.xml
Device updated successfully

# virsh dumpxml rhel7.4 | grep 'vhost'
    <interface type='vhostuser'>
      <source type='unix' path='/var/run/openvswitch/vhost-user1' mode='client'/>
      <driver name='vhost' queues='5' rx_queue_size='1024' tx_queue_size='512'/>


Actual results:
in step 2, the update-device return success but in fact no change for the tx_queue_size and rx_queue size attributes.

Expected results:
the update-device return error like:
error: Failed to update device from inter.xml
error: Operation not supported: cannot modify virtio network device driver attributes

or make changes on the xml and on the guest accordingly.

Additional info:
N/A

Comment 2 Michal Privoznik 2017-08-31 09:39:16 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2017-August/msg01016.html

Comment 3 Michal Privoznik 2017-09-01 08:54:58 UTC
I've pushed the patch upstream:

ommit f0607f394c5567f3a39b4037bb6fd623363e5aa6
Author:     Michal Privoznik <mprivozn>
AuthorDate: Thu Aug 31 11:33:06 2017 +0200
Commit:     Michal Privoznik <mprivozn>
CommitDate: Fri Sep 1 09:50:44 2017 +0200

    qemu: Forbid rx/tx_queue_size change explicitly
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1484230
    
    When updating a virtio enabled vNIC and trying to change either
    of rx_queue_size or tx_queue_size success is reported although no
    operation is actually performed. Moreover, there's no way how to
    change these on the fly. This is due to way we check for changes:
    explicitly for each struct member. Therefore it's easy to miss
    one.
    
    Signed-off-by: Michal Privoznik <mprivozn>

v3.7.0-rc2-3-gf0607f394

Comment 5 yalzhang@redhat.com 2017-09-07 06:28:54 UTC
test on libvirt-3.7.0-2.el7.x86_64, the result is as expected, set this bug to be verified.

live update rx_queue_size or tx_queue_size will report error.

# virsh dumpxml rhel7.4 | grep /interface -B8
    <interface type='vhostuser'>
      <mac address='52:54:00:93:51:db'/>
      <source type='unix' path='/var/run/openvswitch/vhost-user1' mode='client'/>
      <target dev='vhost-user1'/>
      <model type='virtio'/>
      <driver name='vhost' rx_queue_size='1024' tx_queue_size='512'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

# cat interface.xml
<interface type='vhostuser'>
      <mac address='52:54:00:93:51:db'/>
      <source type='unix' path='/var/run/openvswitch/vhost-user1' mode='client'/>
      <target dev='vhost-user1'/>
      <model type='virtio'/>
      <driver name='vhost' rx_queue_size='512' tx_queue_size='512'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

# virsh update-device rhel7.4  interface.xml
error: Failed to update device from interface.xml
error: Operation not supported: cannot modify virtio network device driver attributes

Comment 9 errata-xmlrpc 2018-04-10 10:55:31 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://access.redhat.com/errata/RHEA-2018:0704