From nobody Sun Dec 22 02:21:24 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=solinno.co.uk Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1733318478169903.7172446610532; Wed, 4 Dec 2024 05:21:18 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id C5B1D13DF; Wed, 4 Dec 2024 08:21:16 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 74504136C; Wed, 4 Dec 2024 08:20:48 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 0B806136A; Wed, 4 Dec 2024 08:20:45 -0500 (EST) Received: from doppler.solinno.uk (doppler.solinno.uk [81.2.106.178]) (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 05E9E136B for ; Wed, 4 Dec 2024 08:20:43 -0500 (EST) Received: from folly.solinno.co.uk (folly.dyn.solinno.co.uk [192.168.2.135]) by doppler.solinno.uk (Postfix) with ESMTPSA id BB42620AB5; Wed, 4 Dec 2024 13:20:42 +0000 (GMT) Received: by folly.solinno.co.uk (Postfix, from userid 1000) id 9A3AE200CC; Wed, 4 Dec 2024 13:20:42 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=solinno.co.uk; s=mail; t=1733318442; bh=nUCymzAxCd9q0IB10LI5WW+mfI7hEQmphWxh4ZbZM3c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JU/kYh5ljKonzQ3jwlLJmp8tKFX67f3egpqnvm+RiVZ67FsM0rjI9a226mTanUP7O LHN0QdFkoI8p5/rLzHLL5l9qcylFWV71ZlFpLJ9jN6I6nlIjbvXP0NkAcRwWTglFlP 5yAyNEtQOwZEx5HKtlODeRPQjYHiYwY6oYQ08pc8= From: Leigh Brown To: devel@lists.libvirt.org Subject: [RFC PATCH 1/3] util: bridge: add virNetDevBridgeSetupVlans() Date: Wed, 4 Dec 2024 13:20:35 +0000 Message-Id: <20241204132037.10809-2-leigh@solinno.co.uk> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241204132037.10809-1-leigh@solinno.co.uk> References: <20241204132037.10809-1-leigh@solinno.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: SN2TL4ESQPQQ4KGQTGFNHY7CNVIQHCMB X-Message-ID-Hash: SN2TL4ESQPQQ4KGQTGFNHY7CNVIQHCMB X-MailFrom: leigh@solinno.co.uk 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 CC: Leigh Brown 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 (Computed bodyhash is different from the expected one) X-ZM-MESSAGEID: 1733318480612116600 Content-Type: text/plain; charset="utf-8" In preparation for adding vlan support using iproute2 bridge vlan functionality, add the virNetDevBridgeSetupVlans function that configures a bridge interface using the passed virNetDevVlan struct. Signed-off-by: Leigh Brown --- meson.build | 1 + src/util/virnetdevbridge.c | 54 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/meson.build b/meson.build index ca1b915737..39c01ebeef 100644 --- a/meson.build +++ b/meson.build @@ -857,6 +857,7 @@ optional_programs =3D [ 'ovs-vsctl', 'rmmod', 'tc', + 'bridge', ] + optional_test_programs =20 missing_optional_programs =3D [] diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c index 5fd88f3195..0862342cee 100644 --- a/src/util/virnetdevbridge.c +++ b/src/util/virnetdevbridge.c @@ -24,6 +24,7 @@ #include "virfile.h" #include "virlog.h" #include "virstring.h" +#include "vircommand.h" =20 #ifdef WITH_NET_IF_H # include @@ -379,8 +380,61 @@ virNetDevBridgePortSetIsolated(const char *brname G_GN= UC_UNUSED, _("Unable to set bridge port isolated on this pla= tform")); return -1; } + #endif =20 +static int +virNetDevBridgeSetupVlans(const char *ifname, const virNetDevVlan *virtVla= n) +{ + g_autoptr(virCommand) cmd =3D NULL; + + if (!virtVlan || !virtVlan->nTags) + return 0; + + // The interface will have been automatically added to vlan 1, so remo= ve it + cmd =3D virCommandNewArgList(BRIDGE, "vlan", "delete", + "dev", ifname, "vid", "1", NULL); + if (virCommandRun(cmd, NULL) < 0) + return -1; + + // If trunk mode, add the native VLAN then add any others + if (virtVlan->trunk) { + size_t i; + + virCommandFree(cmd); + cmd =3D virCommandNewArgList(BRIDGE, "vlan", "add", + "dev", ifname, "vid", NULL); + virCommandAddArgFormat(cmd, "%d", virtVlan->nativeTag); + virCommandAddArg(cmd, "pvid"); + if (virtVlan->nativeMode =3D=3D VIR_NATIVE_VLAN_MODE_UNTAGGED) + virCommandAddArg(cmd, "untagged"); + if (virCommandRun(cmd, NULL) < 0) + return -1; + + for (i =3D 0; i < virtVlan->nTags; i++) { + if (virtVlan->tag[i] !=3D virtVlan->nativeTag) { + virCommandFree(cmd); + cmd =3D virCommandNewArgList(BRIDGE, "vlan", "add", + "dev", ifname, "vid", NULL); + virCommandAddArgFormat(cmd, "%d", virtVlan->tag[i]); + if (virCommandRun(cmd, NULL) < 0) + return -1; + } + } + } else { + // In native mode, add the single VLAN as pvid untagged + virCommandFree(cmd); + cmd =3D virCommandNewArgList(BRIDGE, "vlan", "add", + "dev", ifname, "vid", NULL); + virCommandAddArgFormat(cmd, "%d", virtVlan->tag[0]); + virCommandAddArgList(cmd, "pvid", "untagged", NULL); + if (virCommandRun(cmd, NULL) < 0) + return -1; + } + + return 0; +} + =20 /** * virNetDevBridgeCreate: --=20 2.39.5 From nobody Sun Dec 22 02:21:24 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=solinno.co.uk Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1733318499818411.3610206683102; Wed, 4 Dec 2024 05:21:39 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id C183A1371; Wed, 4 Dec 2024 08:21:38 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 046241418; Wed, 4 Dec 2024 08:20:50 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 11163136B; Wed, 4 Dec 2024 08:20:45 -0500 (EST) Received: from doppler.solinno.uk (doppler.solinno.uk [81.2.106.178]) (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 0445E1368 for ; Wed, 4 Dec 2024 08:20:43 -0500 (EST) Received: from folly.solinno.co.uk (3.b.5.6.5.2.6.a.3.1.1.d.1.5.3.b.a.c.f.8.6.f.d.1.0.b.8.0.1.0.0.2.ip6.arpa [IPv6:2001:8b0:1df6:8fca:b351:d113:a625:65b3]) by doppler.solinno.uk (Postfix) with ESMTPSA id D8AB920BF2; Wed, 4 Dec 2024 13:20:42 +0000 (GMT) Received: by folly.solinno.co.uk (Postfix, from userid 1000) id 9C55F20178; Wed, 4 Dec 2024 13:20:42 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=solinno.co.uk; s=mail; t=1733318442; bh=jgJewkTGx/VoeSbIiwHdEfuJC1Kwd8+PhLbeEYaaVw8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E/TgxGjzREMyKUB443JPKOr1MMTBIKpPk0UqCUcrrzaBBslAQYX0plHocTSaPn3Lh Dpi+dgxckXY4avl7GGYUgNWKVkExthtxeymsQCIwY/H1Vi3GmqUZBQgqEi6lrI+L5K toe2krBNFUKrJHO1nYcH6Ywm18jFjlQsiEJHYb90= From: Leigh Brown To: devel@lists.libvirt.org Subject: [RFC PATCH 2/3] util: bridge: virNetDevBridgeAddPort vlan support Date: Wed, 4 Dec 2024 13:20:36 +0000 Message-Id: <20241204132037.10809-3-leigh@solinno.co.uk> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241204132037.10809-1-leigh@solinno.co.uk> References: <20241204132037.10809-1-leigh@solinno.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: IQMH7F74ZKFK4ULYIDXAWZPHW5RTGWNV X-Message-ID-Hash: IQMH7F74ZKFK4ULYIDXAWZPHW5RTGWNV X-MailFrom: leigh@solinno.co.uk 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 CC: Leigh Brown 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 (Computed bodyhash is different from the expected one) X-ZM-MESSAGEID: 1733318501107116600 Content-Type: text/plain; charset="utf-8" Add virVlan parameter to the Linux version of the virNetDevBridgeAddPort function. Update the function to pass the call virNetDevBridgeSetupVlans to run the appropriate iproute2 bridge vlan commands to set up the required vlan configuration. Update callers of this function to pass NULL for now. Signed-off-by: Leigh Brown --- src/lxc/lxc_process.c | 2 +- src/util/virnetdevbridge.c | 11 +++++++---- src/util/virnetdevbridge.h | 4 +++- src/util/virnetdevtap.c | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index cd8bcfc282..2a91896328 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -290,7 +290,7 @@ virLXCProcessSetupInterfaceTap(virDomainDef *vm, vport, virDomainNetGetActualVl= an(net)) < 0) return NULL; } else { - if (virNetDevBridgeAddPort(brname, parentVeth) < 0) + if (virNetDevBridgeAddPort(brname, parentVeth, NULL) < 0) return NULL; =20 if (virDomainNetGetActualPortOptionsIsolated(net) =3D=3D VIR_T= RISTATE_BOOL_YES && diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c index 0862342cee..e0fa2ad15b 100644 --- a/src/util/virnetdevbridge.c +++ b/src/util/virnetdevbridge.c @@ -647,7 +647,8 @@ int virNetDevBridgeDelete(const char *brname G_GNUC_UNU= SED) */ #if defined(WITH_STRUCT_IFREQ) && defined(SIOCBRADDIF) int virNetDevBridgeAddPort(const char *brname, - const char *ifname) + const char *ifname, + const virNetDevVlan *virtVlan) { struct ifreq ifr; VIR_AUTOCLOSE fd =3D -1; @@ -667,11 +668,12 @@ int virNetDevBridgeAddPort(const char *brname, return -1; } =20 - return 0; + return virNetDevBridgeSetupVlans(ifname, virtVlan); } #elif defined(WITH_BSD_BRIDGE_MGMT) int virNetDevBridgeAddPort(const char *brname, - const char *ifname) + const char *ifname, + const virNetDevVlan *virtVlan) { struct ifbreq req =3D { 0 }; =20 @@ -692,7 +694,8 @@ int virNetDevBridgeAddPort(const char *brname, } #else int virNetDevBridgeAddPort(const char *brname, - const char *ifname) + const char *ifname, + const virNetDevVlan *virtVlan) { virReportSystemError(ENOSYS, _("Unable to add bridge %1$s port %2$s"), brname,= ifname); diff --git a/src/util/virnetdevbridge.h b/src/util/virnetdevbridge.h index db4099bf0b..5f51656abe 100644 --- a/src/util/virnetdevbridge.h +++ b/src/util/virnetdevbridge.h @@ -20,6 +20,7 @@ =20 #include "internal.h" #include "virmacaddr.h" +#include "virnetdevvlan.h" =20 int virNetDevBridgeCreate(const char *brname, const virMacAddr *mac) @@ -28,7 +29,8 @@ int virNetDevBridgeDelete(const char *brname) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; =20 int virNetDevBridgeAddPort(const char *brname, - const char *ifname) + const char *ifname, + const virNetDevVlan *virtVlan) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; =20 int virNetDevBridgeRemovePort(const char *brname, diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index 2701ba6dfc..a9573eb8e1 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -483,7 +483,7 @@ virNetDevTapAttachBridge(const char *tapname, return -1; } } else { - if (virNetDevBridgeAddPort(brname, tapname) < 0) + if (virNetDevBridgeAddPort(brname, tapname, NULL) < 0) return -1; =20 if (isolatedPort =3D=3D VIR_TRISTATE_BOOL_YES && --=20 2.39.5 From nobody Sun Dec 22 02:21:24 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=solinno.co.uk Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 173331851931950.508089717465054; Wed, 4 Dec 2024 05:21:59 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 3CEF613AE; Wed, 4 Dec 2024 08:21:58 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id E673D13F8; Wed, 4 Dec 2024 08:20:51 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 8668C1368; Wed, 4 Dec 2024 08:20:45 -0500 (EST) Received: from doppler.solinno.uk (doppler.solinno.uk [81.2.106.178]) (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 08CC2136D for ; Wed, 4 Dec 2024 08:20:43 -0500 (EST) Received: from folly.solinno.co.uk (3.b.5.6.5.2.6.a.3.1.1.d.1.5.3.b.a.c.f.8.6.f.d.1.0.b.8.0.1.0.0.2.ip6.arpa [IPv6:2001:8b0:1df6:8fca:b351:d113:a625:65b3]) by doppler.solinno.uk (Postfix) with ESMTPSA id D8C7120BF3; Wed, 4 Dec 2024 13:20:42 +0000 (GMT) Received: by folly.solinno.co.uk (Postfix, from userid 1000) id 9EA2E2017F; Wed, 4 Dec 2024 13:20:42 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=solinno.co.uk; s=mail; t=1733318442; bh=keoRh1A9gMvtrPVeI6J3NFAbsVr1eNX9A/O6AQNC1+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=24vM4knypcIhj6pGjPTOazAAkn2Q8IeKc5h1xC1kaIRRE65qhadJPAta27S4mAilp RKYPKuROUQ2X6H2uqbKIlb5YJjuQ0nRHRPJipXgxxKiPUw++SW0PulyRVcv8khFEeH ej7Zmn8Qx9l0Z3aA0ll9v+b6I0stWgnG8+/M2q3g= From: Leigh Brown To: devel@lists.libvirt.org Subject: [RFC PATCH 3/3] util: bridge: enable bridge vlan support Date: Wed, 4 Dec 2024 13:20:37 +0000 Message-Id: <20241204132037.10809-4-leigh@solinno.co.uk> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241204132037.10809-1-leigh@solinno.co.uk> References: <20241204132037.10809-1-leigh@solinno.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 3A3OLGGRJRAYRWMJCA7CAPQK33CXRQPO X-Message-ID-Hash: 3A3OLGGRJRAYRWMJCA7CAPQK33CXRQPO X-MailFrom: leigh@solinno.co.uk 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 CC: Leigh Brown 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 (Computed bodyhash is different from the expected one) X-ZM-MESSAGEID: 1733318520593116600 Content-Type: text/plain; charset="utf-8" Allow VLAN configuration for bridge interfaces and pass the VLAN configuration when adding the tap interface to the bridge. Signed-off-by: Leigh Brown --- src/conf/domain_validate.c | 3 ++- src/lxc/lxc_process.c | 3 ++- src/util/virnetdevtap.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 1034bb57f5..c7a79a0277 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -2077,7 +2077,8 @@ virDomainActualNetDefValidate(const virDomainNetDef *= net) (actualType =3D=3D VIR_DOMAIN_NET_TYPE_DIRECT && virDomainNetGetActualDirectMode(net) =3D=3D VIR_NETDEV_MACV= LAN_MODE_PASSTHRU) || (actualType =3D=3D VIR_DOMAIN_NET_TYPE_BRIDGE && - vport && vport->virtPortType =3D=3D VIR_NETDEV_VPORT_PROFI= LE_OPENVSWITCH))) { + vport && vport->virtPortType =3D=3D VIR_NETDEV_VPORT_PROFI= LE_OPENVSWITCH) || + (actualType =3D=3D VIR_DOMAIN_NET_TYPE_BRIDGE && !vport))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("interface %1$s - vlan tag not supported for = this connection type"), macstr); diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index 2a91896328..7c8dc703ca 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -290,7 +290,8 @@ virLXCProcessSetupInterfaceTap(virDomainDef *vm, vport, virDomainNetGetActualVl= an(net)) < 0) return NULL; } else { - if (virNetDevBridgeAddPort(brname, parentVeth, NULL) < 0) + if (virNetDevBridgeAddPort(brname, parentVeth, + virDomainNetGetActualVlan(net)) < 0) return NULL; =20 if (virDomainNetGetActualPortOptionsIsolated(net) =3D=3D VIR_T= RISTATE_BOOL_YES && diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index a9573eb8e1..1dc77f0f5c 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -483,7 +483,7 @@ virNetDevTapAttachBridge(const char *tapname, return -1; } } else { - if (virNetDevBridgeAddPort(brname, tapname, NULL) < 0) + if (virNetDevBridgeAddPort(brname, tapname, virtVlan) < 0) return -1; =20 if (isolatedPort =3D=3D VIR_TRISTATE_BOOL_YES && --=20 2.39.5