From: Peter Krempa Date: Tue, 27 Aug 2024 07:56:47 +0000 (+0200) Subject: hypervisor: interface: Stub out virDomainCreateInBridgePortWithHelper using 'socketpa... X-Git-Tag: v10.7.0-rc1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=805f66d7cab6b6dc69ad1496d9483808d6bc1f59;p=thirdparty%2Flibvirt.git hypervisor: interface: Stub out virDomainCreateInBridgePortWithHelper using 'socketpair' on win32 Mingw build failed after commit af87ee7927d3245582d82d36da25b4dc3b34465e as 'socketpair()' is not available on that platform. Stub out the function to return failure. Fixes: af87ee7927d3245582d82d36da25b4dc3b34465e Signed-off-by: Peter Krempa Reviewed-by: Jiri Denemark --- diff --git a/src/hypervisor/domain_interface.c b/src/hypervisor/domain_interface.c index fc82624bb9..5cdba279fa 100644 --- a/src/hypervisor/domain_interface.c +++ b/src/hypervisor/domain_interface.c @@ -532,6 +532,7 @@ virDomainClearNetBandwidth(virDomainDef *def) * * Returns 0 in case of success or -1 on failure */ +#ifndef WIN32 static int virDomainCreateInBridgePortWithHelper(const char *bridgeHelperName, const char *brname, @@ -583,9 +584,9 @@ virDomainCreateInBridgePortWithHelper(const char *bridgeHelperName, virCommandPassFD(cmd, pair[1], VIR_COMMAND_PASS_FD_CLOSE_PARENT); virCommandClearCaps(cmd); -#ifdef CAP_NET_ADMIN +# ifdef CAP_NET_ADMIN virCommandAllowCap(cmd, CAP_NET_ADMIN); -#endif +# endif if (virCommandRunAsync(cmd, NULL) < 0) { *tapfd = -1; goto cleanup; @@ -626,6 +627,20 @@ virDomainCreateInBridgePortWithHelper(const char *bridgeHelperName, return *tapfd < 0 ? -1 : 0; } +#else /* WIN32 */ + +static int +virDomainCreateInBridgePortWithHelper(const char *bridgeHelperName G_GNUC_UNUSED, + const char *brname G_GNUC_UNUSED, + char **ifname G_GNUC_UNUSED, + int *tapfd G_GNUC_UNUSED, + unsigned int unusedflags G_GNUC_UNUSED) +{ + virReportSystemError(ENOSYS, "%s", + _("bridge port creation is not supported on this platform")); + return -1; +} +#endif /* virDomainInterfaceBridgeConnect: * @def: the definition of the VM