From nobody Mon Feb 2 05:57:17 2026 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; 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1768498662; cv=none; d=zohomail.com; s=zohoarc; b=Qx2WyABvGDG7vKmiCU4IOOyEdfJRdrszi642E8yyu9en/gmNeS29+PgqSC2mDdnPcKkLnwfW1T4kZ8V2q/05BkHrEbzwx019DoeAF5f+59D52sSnq0qAqaoFzspc8LKxkYRE4Tt9fmPmyDPJqEh+xjsPVGlY0fBCCXQhZ1snUi4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768498662; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=oOogYrDezjru5ZQMMQSDkDCWn4defvLFfTqguAe3KDE=; b=cem3zBQSgSCfoRBGjIdOm5331Ff209Xi61rUAYkFlbbLjGl97pjT2vIWJ59wdk5wmfibOUwSEnJ0649K+/OAGTLMELYSxFS3TyHwmGqUbVBneDedBRkv4JznU4MJudzMW5PTjNIh5LtdakfkkAKnsOg+jgXuEG10d7JNeXd7chs= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1768498662247249.37961397790104; Thu, 15 Jan 2026 09:37:42 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 4AB1B41AB4; Thu, 15 Jan 2026 12:37:41 -0500 (EST) Received: from [172.19.199.83] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id A7E67418DC; Thu, 15 Jan 2026 12:36:22 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id C469241AC2; Thu, 15 Jan 2026 12:36:08 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 1FB3641AA5 for ; Thu, 15 Jan 2026 12:36:06 -0500 (EST) Received: from mx-prod-mc-01.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-187-_UagcZYAPW6VY35kDcPSMw-1; Thu, 15 Jan 2026 12:36:04 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9CEEF1954B0C for ; Thu, 15 Jan 2026 17:36:03 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.22.64.106]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 457673001DB9 for ; Thu, 15 Jan 2026 17:36:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768498565; 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: in-reply-to:in-reply-to:references:references; bh=oOogYrDezjru5ZQMMQSDkDCWn4defvLFfTqguAe3KDE=; b=WaL0wB/dO8FIVkDGrzf7q8fwhT2tH3kSe8ybMFq9tgF74LXfSj5waekgQd1WStu9NFEqJ/ pxHJFzcnbKHHpIutQuaAe+pZHYswZd5A+uBV3fGlMwUVh2JIb2mb/il2AdmqVLZtFkJwv9 N8zsKJOFPb81Ae7Vk3T2vY4FxQO/mfY= X-MC-Unique: _UagcZYAPW6VY35kDcPSMw-1 X-Mimecast-MFC-AGG-ID: _UagcZYAPW6VY35kDcPSMw_1768498563 To: devel@lists.libvirt.org Subject: [PATCH 1/4] qemu: update vlan tag of macvtap (direct) passthrough devices during update-device Date: Thu, 15 Jan 2026 12:35:58 -0500 Message-ID: <20260115173601.514507-2-laine@redhat.com> In-Reply-To: <20260115173601.514507-1-laine@redhat.com> References: <20260115173601.514507-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 55a3KvM2uH-73necWi_gSTXW-8v6UYiAPOzjYH3Bd0I_1768498563 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: MC7HP6LCFBUK7FQD6T5SIHAATII2EJC2 X-Message-ID-Hash: MC7HP6LCFBUK7FQD6T5SIHAATII2EJC2 X-MailFrom: laine@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Laine Stump via Devel Reply-To: Laine Stump X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1768498665236158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Laine Stump We already update the vlan tag of interfaces that are attached to an OVS bridge or Linux host bridge. This patch adds the bit of code necessary to update the vlan tag of a macvtap passthrough interface (the only other type of interface that supports vlan tagging). Resolves: https://issues.redhat.com/browse/RHEL-74487 Resolves: https://issues.redhat.com/browse/RHEL-7300 Signed-off-by: Laine Stump Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_hotplug.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index fccbef5d0c..6d20e3a850 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -4265,11 +4265,21 @@ qemuDomainChangeNet(virQEMUDriver *driver, */ if (virNetDevOpenvswitchUpdateVlan(newdev->ifname, &newdev->vl= an) < 0) goto cleanup; - } else { + } else if (newType =3D=3D VIR_DOMAIN_NET_TYPE_DIRECT && + virDomainNetGetActualDirectMode(newdev) =3D=3D VIR_NETD= EV_MACVLAN_MODE_PASSTHRU) { + if (virNetDevSetNetConfig(virDomainNetGetActualDirectDev(newde= v), + -1, NULL, virDomainNetGetActualVlan(= newdev), NULL, true) < 0) { + goto cleanup; + } + } else if (newBridgeName) { /* vlan setup is done as a part of reconnecting the tap * device to a new bridge (either OVS or Linux host bridge). */ needBridgeChange =3D true; + } else { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("unable to change vlan on '%1$s' network type= "), + virDomainNetTypeToString(newType)); } needReplaceDevDef =3D true; } --=20 2.52.0 From nobody Mon Feb 2 05:57:17 2026 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; 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1768498769; cv=none; d=zohomail.com; s=zohoarc; b=fn9AE7qBlw4D7nPwLTbfHZYGooCr3FsKkOY6kWsd/tMNnx94IBsTG01OrqX/k5SvXC7puOdEB5BSvgNrlYqnSZHJchICnL1ydrqTWkysJlOS0/WAZiWQqKdmbJq9tx8obOHGxy9BZjK24JXIs7LSVpCRvO3rEjgHe4dqYp/uHmU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768498769; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=LxcI1Fvywzv+83FPcEffnFx4eMsTwMmKVWflUMtILQU=; b=GYR9AY5kpnDPhedMJap3stYER/KxJTuTTahUvrbONH7YqEKUvx9nMUJMOpTYXyPTaK4aKR/z62qFD27JKY6OOBeIwIioimjTYFVM373gJqN4wuqlTAPslNVuWVmCXd7OZbpvW/AzWCZfHcX5OeYYzF8djeJrvWOTuHmqiaV9KDE= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1768498769235811.1441018756797; Thu, 15 Jan 2026 09:39:29 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 4740F41AD6; Thu, 15 Jan 2026 12:39:28 -0500 (EST) Received: from [172.19.199.83] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id A665E43EB9; Thu, 15 Jan 2026 12:36:34 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 22AD24188C; Thu, 15 Jan 2026 12:36:10 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 7206D41AAD for ; Thu, 15 Jan 2026 12:36:07 -0500 (EST) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-304-j_qxk1djNuOPDl7ED3TLZg-1; Thu, 15 Jan 2026 12:36:05 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 34B571800610 for ; Thu, 15 Jan 2026 17:36:04 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.22.64.106]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CEFCB3001DB9 for ; Thu, 15 Jan 2026 17:36:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768498567; 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: in-reply-to:in-reply-to:references:references; bh=LxcI1Fvywzv+83FPcEffnFx4eMsTwMmKVWflUMtILQU=; b=TK9TZKbhOMC0zpmX56yt9rd2nJXO7ZT6ABaoELgUHqvY8FsTDm5RCQQEs4MCWiBB9jo5Pa aTGyxP6gpWjvL/5/+xSVc7XpbsZ6bpDik61lQDjRdGAoCPqP4WUx4PTJBynV6f9oTz3NNm 4F9ra/wnTjrzSLJSgFRJ5ts8LX0iYBk= X-MC-Unique: j_qxk1djNuOPDl7ED3TLZg-1 X-Mimecast-MFC-AGG-ID: j_qxk1djNuOPDl7ED3TLZg_1768498564 To: devel@lists.libvirt.org Subject: [PATCH 2/4] qemu: use actual/effective vlan when updating OVS-based interface vlan tag Date: Thu, 15 Jan 2026 12:35:59 -0500 Message-ID: <20260115173601.514507-3-laine@redhat.com> In-Reply-To: <20260115173601.514507-1-laine@redhat.com> References: <20260115173601.514507-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: lgPuP_pwaQ9Nx_k8G0aiO7fwwxrnpp7u7jSs4UmhoXQ_1768498564 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: H4US5PNKWASY4AODTEXT5TY4R33MVM4Y X-Message-ID-Hash: H4US5PNKWASY4AODTEXT5TY4R33MVM4Y X-MailFrom: laine@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Laine Stump via Devel Reply-To: Laine Stump X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1768498769573158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Laine Stump Using &newdev->vlan when updating the vlan tag causes problems if the interface is using a libvirt virtual network to get its vlan tag info - in this case the info won't be properly pulled from the virtual netw= ork config, but instead it will just use the (empty) vlan object from the netdef. The proper thing to do is to use virDomainNetGetActualVlan(), which will pull the vlan tag from the network definition, if applicable. Signed-off-by: Laine Stunp Signed-off-by: Laine Stump Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 6d20e3a850..c5905dba23 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -4263,7 +4263,7 @@ qemuDomainChangeNet(virQEMUDriver *driver, * will redo vlan setup without needing to re-attach the * tap device to the bridge */ - if (virNetDevOpenvswitchUpdateVlan(newdev->ifname, &newdev->vl= an) < 0) + if (virNetDevOpenvswitchUpdateVlan(newdev->ifname, virDomainNe= tGetActualVlan(newdev)) < 0) goto cleanup; } else if (newType =3D=3D VIR_DOMAIN_NET_TYPE_DIRECT && virDomainNetGetActualDirectMode(newdev) =3D=3D VIR_NETD= EV_MACVLAN_MODE_PASSTHRU) { --=20 2.52.0 From nobody Mon Feb 2 05:57:17 2026 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; 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1768498701; cv=none; d=zohomail.com; s=zohoarc; b=gwVG+bMGliCin/gSKYnEPNxrOUyDU3aNG9e+VwLSckQzxEXpvkSX8B79RBCUwNFGobfMj0+R6OxtfB87WSHoALsZiZb90vAly4K+jBvVkNLtz17ZFSMUEYiP1hmA/luNCsRdH6xMuHLTrcdcDoh3pBex5EBFuchgMLkeZ4Uh1bk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768498701; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=Ycvmcw08Tu/576G7dqmon8+xrCk6BW51dJ81GNazLGw=; b=VHNjtn+KB690pUcQoE+kkDVEO7/9cynlv6WoiiJk2KEpN/BJxl+B3DHGY5EcAO5g8f80wmSn2rGnxc/RjpoTaS3DjFIo5TgsgxP/oGXWxCl0QVrwKb/H4nXItvm0WHzHMoS2iwhyyPVm/0rIONW6SIC/XmYw3DE2cw4a7v+qxIU= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1768498701059944.474428654671; Thu, 15 Jan 2026 09:38:21 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 27A864188D; Thu, 15 Jan 2026 12:38:20 -0500 (EST) Received: from [172.19.199.83] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 24E7541B8D; Thu, 15 Jan 2026 12:36:26 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 4AC7C41AA5; Thu, 15 Jan 2026 12:36:09 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 639FF41AA9 for ; Thu, 15 Jan 2026 12:36:07 -0500 (EST) Received: from mx-prod-mc-01.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-580-tGxa4caKOVGUzF6DTP82hg-1; Thu, 15 Jan 2026 12:36:05 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BEE4C1956050 for ; Thu, 15 Jan 2026 17:36:04 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.22.64.106]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 661543001DBB for ; Thu, 15 Jan 2026 17:36:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768498567; 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: in-reply-to:in-reply-to:references:references; bh=Ycvmcw08Tu/576G7dqmon8+xrCk6BW51dJ81GNazLGw=; b=BVpbEtIRioA3LLmwuXa9UURHMOwo+sm8EjKapDI0cHBmUM3lAZbi8UFE3UCZcUgQU4Drk7 An/x7xHduF9KNGl8ZpJLQ86oxNJTSYn59fpk8h4zD2yM9eeDLwloK/raFBrZ7RZ2P57zNt HoNQN6rNBg6KRFEI5WWUKYnSCG8l6hs= X-MC-Unique: tGxa4caKOVGUzF6DTP82hg-1 X-Mimecast-MFC-AGG-ID: tGxa4caKOVGUzF6DTP82hg_1768498564 To: devel@lists.libvirt.org Subject: [PATCH 3/4] conf: validate that specified interface type supports vlan tags Date: Thu, 15 Jan 2026 12:36:00 -0500 Message-ID: <20260115173601.514507-4-laine@redhat.com> In-Reply-To: <20260115173601.514507-1-laine@redhat.com> References: <20260115173601.514507-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: QssUryoXpUteOM02qTALvF0XUqev8ksYHFu68bcWZyI_1768498564 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: Y4KHUSLXKEDYVDWHXYM3KAIO4EXZHPZZ X-Message-ID-Hash: Y4KHUSLXKEDYVDWHXYM3KAIO4EXZHPZZ X-MailFrom: laine@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Laine Stump via Devel Reply-To: Laine Stump X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1768498703261158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Laine Stump Somehow this was never done in virDomainNetDefValidate() (which is run immediately post-parse) - it was only in virDomainActualNetDefValidate() (which isn't done until the interface is actually attached to the domain). While it is true that we *might* not know if vlan tagging is supported for the interface if the interface type =3D=3D 'network', we otherwise will always know right away, so we may as well check sooner than later. Signed-off-by: Laine Stump Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_validate.c | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 7346a61731..4589965923 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -2377,6 +2377,47 @@ virDomainNetDefValidate(const virDomainNetDef *net) return -1; } =20 + if (net->vlan.nTags > 0) { + /* vlan configuration via libvirt is only supported for PCI + * Passthrough SR-IOV devices (hostdev or macvtap passthru + * mode) and openvswitch/linux host bridges. (Also allow it in + * the case where we don't yet know what the exact connection + * type will be, i.e. NET_TYPE_NETWORK). + */ + bool vlanAllowed =3D false; + + switch (net->type) { + case VIR_DOMAIN_NET_TYPE_HOSTDEV: + case VIR_DOMAIN_NET_TYPE_NETWORK: + case VIR_DOMAIN_NET_TYPE_BRIDGE: + vlanAllowed =3D true; + break; + case VIR_DOMAIN_NET_TYPE_DIRECT: + if (net->data.direct.mode =3D=3D VIR_NETDEV_MACVLAN_MODE_PASST= HRU) + vlanAllowed =3D true; + break; + case VIR_DOMAIN_NET_TYPE_ETHERNET: + case VIR_DOMAIN_NET_TYPE_USER: + case VIR_DOMAIN_NET_TYPE_VHOSTUSER: + case VIR_DOMAIN_NET_TYPE_SERVER: + case VIR_DOMAIN_NET_TYPE_CLIENT: + case VIR_DOMAIN_NET_TYPE_MCAST: + case VIR_DOMAIN_NET_TYPE_INTERNAL: + case VIR_DOMAIN_NET_TYPE_UDP: + case VIR_DOMAIN_NET_TYPE_VDPA: + case VIR_DOMAIN_NET_TYPE_NULL: + case VIR_DOMAIN_NET_TYPE_VDS: + case VIR_DOMAIN_NET_TYPE_LAST: + break; + } + if (!vlanAllowed) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("interface %1$s - vlan tag not supported for = this connection type"), + macstr); + return -1; + } + } + return 0; } =20 --=20 2.52.0 From nobody Mon Feb 2 05:57:17 2026 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; 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1768498735; cv=none; d=zohomail.com; s=zohoarc; b=OqR/rR64hOS88+wX6espS9zsTxeNje6VyS/bUaFDpR0lgW5qs3/Jt1HX38YaiXC/mV0p13ofFZyBE+raGk+sQ32YHJU+6WufFr5J+hrdcgYGSqTKQsZkx4eZEuc4LmhUnT7hmhV5GJ3ep/WlAAxKikbBi+itlufwvH93iEa0hWg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768498735; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=zx/gHslJBIsQ31dPSRrKr9eSGyJyWu/3aNmWQQUNjzE=; b=QNyIatxx6NFIVCzuB85D+1N2+xqBDmuj6yvCSGXHhyTfh21RxEQuNzbkTNxBnL/93VgNCK+fUIMGKiAQYB0iQlU/AgQbNaz6XPGZjShq9wui9TOvtwjaMsZW0poOBjeqory6l3ZM8wc/uO1j5ilig6niIsb9Ar7RqCsTN6ak8DU= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1768498735324458.57735517689366; Thu, 15 Jan 2026 09:38:55 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 7526D4190E; Thu, 15 Jan 2026 12:38:54 -0500 (EST) Received: from [172.19.199.83] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 6256343E6C; Thu, 15 Jan 2026 12:36:30 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 7FD6D41AA5; Thu, 15 Jan 2026 12:36:09 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id CC1C241AAF for ; Thu, 15 Jan 2026 12:36:07 -0500 (EST) Received: from mx-prod-mc-01.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-596-S4uS0YGkODuwxWcfgF8EDQ-1; Thu, 15 Jan 2026 12:36:06 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 55C4419540E3 for ; Thu, 15 Jan 2026 17:36:05 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.22.64.106]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F0A2A3001DBC for ; Thu, 15 Jan 2026 17:36:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768498567; 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: in-reply-to:in-reply-to:references:references; bh=zx/gHslJBIsQ31dPSRrKr9eSGyJyWu/3aNmWQQUNjzE=; b=FkKvzhOWZxcwzpbKEBoirENNI0HmjJUeJsilPqUfxBNsMKmNq3Pi/4t4VFq4m8Pcxet0x3 ZvwcJhXuyj4oEyfZ+IvHNMisz+RWWmojcUNq11mP3khO8G9wlMqG7neDjAtS6V0ciC7iRz x3S7NGDqmYj0qtElgzkyZz/3EXVo/7Q= X-MC-Unique: S4uS0YGkODuwxWcfgF8EDQ-1 X-Mimecast-MFC-AGG-ID: S4uS0YGkODuwxWcfgF8EDQ_1768498565 To: devel@lists.libvirt.org Subject: [PATCH 4/4] conf: simplify check for vlan tagging support in virDomainActualNetDefValidate() Date: Thu, 15 Jan 2026 12:36:01 -0500 Message-ID: <20260115173601.514507-5-laine@redhat.com> In-Reply-To: <20260115173601.514507-1-laine@redhat.com> References: <20260115173601.514507-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: yTNV7IX88sap2veQi8tSmnp3Kb5cQ6TiM8amv1spLqI_1768498565 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 6DZWRFMOTVPYBQRDJSCEORIL5ARH7RHN X-Message-ID-Hash: 6DZWRFMOTVPYBQRDJSCEORIL5ARH7RHN X-MailFrom: laine@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Laine Stump via Devel Reply-To: Laine Stump X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1768498737401158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Laine Stump Since the only two types of bridges we support are OVS bridges and Linux host bridges, and since both of those now support vlan tagging, we don't need to check the virtualport type etc - if there is a bridge specified then we know the interface will support vlan tagging. Signed-off-by: Laine Stump Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_validate.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 4589965923..4482203087 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -2229,15 +2229,12 @@ virDomainActualNetDefValidate(const virDomainNetDef= *net) if (virDomainNetGetActualVlan(net)) { /* vlan configuration via libvirt is only supported for PCI * Passthrough SR-IOV devices (hostdev or macvtap passthru - * mode) and openvswitch bridges. Otherwise log an error and - * fail + * mode) and openvswitch/linux host bridges. */ - if (!(actualType =3D=3D VIR_DOMAIN_NET_TYPE_HOSTDEV || + if (!(virDomainNetGetActualBridgeName(net) || + actualType =3D=3D VIR_DOMAIN_NET_TYPE_HOSTDEV || (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_PROFIL= E_OPENVSWITCH) || - (actualType =3D=3D VIR_DOMAIN_NET_TYPE_BRIDGE && !vport))) { + virDomainNetGetActualDirectMode(net) =3D=3D VIR_NETDEV_MACV= LAN_MODE_PASSTHRU))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("interface %1$s - vlan tag not supported for = this connection type"), macstr); --=20 2.52.0