From: Peter Krempa Date: Mon, 4 Dec 2023 15:28:23 +0000 (+0100) Subject: qemuxml2argvmock: Mock virNetDevSetMTU X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1948244461cdd40461ab4e4441e54504f25fa900;p=libvirt.git qemuxml2argvmock: Mock virNetDevSetMTU Unfortunately the network backend commandline formatter attempts to also setup the backend itself, which it really should not. For now make sure qemuxml2argvtest can call virNetDevSetMTU. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h index 05daed09e9..c287a7b272 100644 --- a/src/util/virnetdev.h +++ b/src/util/virnetdev.h @@ -202,7 +202,7 @@ int virNetDevSetCoalesce(const char *ifname, int virNetDevSetMTU(const char *ifname, int mtu) - ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT G_NO_INLINE; int virNetDevSetMTUFromDevice(const char *ifname, const char *otherifname) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c index f2696bd4c3..9cc97199c4 100644 --- a/tests/qemuxml2argvmock.c +++ b/tests/qemuxml2argvmock.c @@ -284,3 +284,11 @@ virIdentityEnsureSystemToken(void) { return g_strdup("3de80bcbf22d4833897f1638e01be9b2"); } + + +int +virNetDevSetMTU(const char *ifname G_GNUC_UNUSED, + int mtu G_GNUC_UNUSED) +{ + return 0; +}