From nobody Sat Nov 23 14:14:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1724745782416374.4140653993354; Tue, 27 Aug 2024 01:03:02 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 4BB39D3A; Tue, 27 Aug 2024 04:03:01 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 37A52D45; Tue, 27 Aug 2024 04:02:45 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 23D90CD0; Tue, 27 Aug 2024 04:02:43 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id A2139D3A for ; Tue, 27 Aug 2024 04:02:42 -0400 (EDT) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-678-06HCE8t_OGCqgM6du_xeZA-1; Tue, 27 Aug 2024 04:02:40 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D2E121955D50 for ; Tue, 27 Aug 2024 08:02:39 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.24]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D41031956053 for ; Tue, 27 Aug 2024 08:02:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724745762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CNs/fcPaQOdzUjxcnDmpcDE1EqW9Z4o53AJps/WFhdI=; b=ZakTumirBq86lXi281n/i0jb3cmw8erW1lT54zrMCgJ5TJYxbe20HG/25rkLIZjSmnjZqh x791Pb1+pS4TgrgF1AgyArmaW6Su0PPa0FfrbAXpOpmnYgI1koXePfs6+jSVXcjXktfPEb 0/2WPXiI5Rjg79Jh2XE0Zv+Ea5uphZ0= X-MC-Unique: 06HCE8t_OGCqgM6du_xeZA-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH] hypervisor: interface: Stub out virDomainCreateInBridgePortWithHelper using 'socketpair' on win32 Date: Tue, 27 Aug 2024 10:02:37 +0200 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 65Z2CNM3ZYVZU5IS7HUQEYPGSDMQHIPH X-Message-ID-Hash: 65Z2CNM3ZYVZU5IS7HUQEYPGSDMQHIPH X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1724745783368116600 Content-Type: text/plain; charset="utf-8" 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 --- Pipeline: https://gitlab.com/pipo.sk/libvirt/-/pipelines/1428482965 (Ignore the broken Cirrus jobs. Something broke and it can't find master branch when building from my user. I blame github :D) src/hypervisor/domain_interface.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/hypervisor/domain_interface.c b/src/hypervisor/domain_inte= rface.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 *bridg= eHelperName, 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 =3D -1; goto cleanup; @@ -626,6 +627,20 @@ virDomainCreateInBridgePortWithHelper(const char *brid= geHelperName, 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_UNUS= ED) +{ + virReportSystemError(ENOSYS, "%s", + _("bridge port creation is not supported on this = platform")); + return -1; +} +#endif /* virDomainInterfaceBridgeConnect: * @def: the definition of the VM --=20 2.46.0