Hide Forgot
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:
Patch proposed upstream: https://www.redhat.com/archives/libvir-list/2017-June/msg00439.html
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
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
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