Bug 1447618

Summary: update-device failed to update the mtu of interface but return as succeed
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: mprivozn, 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:43:32 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-05-03 10:43:27 UTC
Description of problem:
update-device failed to update the mtu of interface but return as succeed

Version-Release number of selected component (if applicable):
libvirt-3.2.0-3.el7.x86_64
qemu-kvm-rhev-2.9.0-2.el7.x86_64
kernel-3.10.0-640.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. 
# virsh net-dumpxml default
<network>
  <name>default</name>
  <uuid>9feee285-f4a5-491e-a68f-0d3ee4805921</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mtu size='9000'/>
  <mac address='52:54:00:77:9a:74'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254'/>
    </dhcp>
  </ip>
</network>

# virsh dumpxml rhel7 | grep /interface -B7
    <interface type='network'>
      <mac address='52:54:00:c2:66:40'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

# ifconfig | grep mtu
......
virbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000
vnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000

2. add mtu settings in the xml and update by update-device, the command succeed
# cat net
   <interface type='network'>
      <mac address='52:54:00:c2:66:40'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <mtu size='4000'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

# virsh update-device rhel7 net
Device updated successfully

# echo $?
0


3. But in fact, it fails to update the mtu of the interface
# virsh dumpxml rhel7 | grep /interface -B7
    <interface type='network'>
      <mac address='52:54:00:c2:66:40'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
# ifconfig | grep mtu
......
virbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000
vnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000


Actual results:
The update-device failed to update mtu but return success

Expected results:
Should pop up error message if no support to update mtu, or update accordingly

Additional info:

Comment 2 Michal Privoznik 2017-06-08 11:51:13 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2017-June/msg00439.html

Comment 3 Michal Privoznik 2017-06-08 14:57:31 UTC
I've just pushed patches upstream:

commit 5f44d7e357f61f7be636a0e2e6d35453cbc3b589
Author:     Michal Privoznik <mprivozn>
AuthorDate: Thu Jun 8 13:45:31 2017 +0200
Commit:     Michal Privoznik <mprivozn>
CommitDate: Thu Jun 8 16:53:07 2017 +0200

    qemuDomainChangeNet: Forbid changing MTU
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1447618
    
    Currently, any attempt to change MTU on an interface that is
    plugged to a running domain is silently ignored. We should either
    do what's asked or error out. Well, we can update the host side
    of the interface, but we cannot change 'host_mtu' attribute for
    the virtio-net device. Therefore we have to error out.
    
    Signed-off-by: Michal Privoznik <mprivozn>
    Reviewed-by: Laine Stump <laine>

v3.4.0-82-g5f44d7e35

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

Update mtu in a running guest it will error out:

# cat interface.xml
<interface type='network'>
      <mac address='52:54:00:21:e8:3f'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
   <mtu size='5000'/>
      <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 MTU

Comment 9 errata-xmlrpc 2018-04-10 10:43:32 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