]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Assume QEMU_CAPS_VIRTIO_NET_HOST_MTU
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 7 Nov 2022 14:12:09 +0000 (15:12 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 8 Nov 2022 11:10:50 +0000 (12:10 +0100)
Introduced in QEMU's commit of v2.9.0-rc0~162^2~10 the .host_mtu
attribute of virtio-net device is always available for all QEMU
versions we support (4.2.0, currently). Therefore, we can assume
the capability is always set and thus doesn't need to be checked
for.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_validate.c
tests/qemuxml2xmltest.c

index 88f2aa8c49cae546bb76dc802e62c145d61a727e..c01bc6f8b57e18fc85aee69e3fc34e017dff5064 100644 (file)
@@ -1889,14 +1889,6 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net,
                            _("virtio rss hash report is not supported with this QEMU binary"));
             return -1;
         }
-
-        if (net->mtu &&
-            !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_NET_HOST_MTU)) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("setting MTU is not supported with this "
-                             "QEMU binary"));
-            return -1;
-        }
     }
 
     if (net->mtu &&
index e8261b7e8cafeb8ea91c9e834351fe4db75a79f1..3a117ff1379ea5d5b38a44f2cb80bbdf34b02c08 100644 (file)
@@ -493,7 +493,7 @@ mymain(void)
     DO_TEST_NOCAPS("watchdog");
     DO_TEST("net-bandwidth", QEMU_CAPS_DEVICE_VGA, QEMU_CAPS_VNC);
     DO_TEST("net-bandwidth2", QEMU_CAPS_DEVICE_VGA, QEMU_CAPS_VNC);
-    DO_TEST("net-mtu", QEMU_CAPS_VIRTIO_NET_HOST_MTU);
+    DO_TEST_NOCAPS("net-mtu");
     DO_TEST_NOCAPS("net-coalesce");
     DO_TEST_NOCAPS("net-many-models");
     DO_TEST("net-vdpa", QEMU_CAPS_NETDEV_VHOST_VDPA);