[PATCH 31/48] qemu: Assume QEMU_CAPS_VIRTIO_NET_HOST_MTU

Michal Privoznik posted 48 patches 3 years, 3 months ago
[PATCH 31/48] qemu: Assume QEMU_CAPS_VIRTIO_NET_HOST_MTU
Posted by Michal Privoznik 3 years, 3 months ago
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>
---
 src/qemu/qemu_validate.c | 8 --------
 tests/qemuxml2xmltest.c  | 2 +-
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 88f2aa8c49..c01bc6f8b5 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -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 &&
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index e8261b7e8c..3a117ff137 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -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);
-- 
2.37.4
Re: [PATCH 31/48] qemu: Assume QEMU_CAPS_VIRTIO_NET_HOST_MTU
Posted by Ján Tomko 3 years, 3 months ago
On a Tuesday in 2022, Michal Privoznik wrote:
>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>
>---
> src/qemu/qemu_validate.c | 8 --------
> tests/qemuxml2xmltest.c  | 2 +-
> 2 files changed, 1 insertion(+), 9 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano