]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuDomainChangeNet: Forbid changing MTU
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 8 Jun 2017 11:45:31 +0000 (13:45 +0200)
committerLaine Stump <laine@laine.org>
Thu, 6 Jul 2017 18:55:45 +0000 (14:55 -0400)
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@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
(cherry picked from commit 5f44d7e357f61f7be636a0e2e6d35453cbc3b589)

src/qemu/qemu_hotplug.c

index 34accb2e3786cf4efee7de557dc7a16355f2dea7..84d12291cbd882baa9b003aee51f8303c7fb3868 100644 (file)
@@ -3136,6 +3136,12 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
     /* vlan can be modified, and will be checked later */
     /* linkstate can be modified */
 
+    if (olddev->mtu != newdev->mtu) {
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                       _("cannot modify MTU"));
+        goto cleanup;
+    }
+
     /* allocate new actual device to compare to old - we will need to
      * free it if we fail for any reason
      */