From nobody Sat Feb 7 08:53:20 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; 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=1770067545; cv=none; d=zohomail.com; s=zohoarc; b=BTvkSAWsWUnjRlUuPq8r/9eRiYcxgMFwYfhim4kj7h+SfLdblGTIjhX/hvgWE/xlitCvngbFtG6YiPmOBWebeo7aSQd9+mPXgqT5GFzKYzKry3+atf+x94g50BkYTrAxoxhm2togX/xcocLGOIwveoZJr86yJHoxRrEVRCZyyA0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770067545; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id; bh=btF7g0X5uBLofpzFu7Lnv8z/aT0l6GY64L0Zz5ItfPo=; b=a1aiyk+TDkc60JMakqt2V+dX3sGhxfkCEPYofaZke9Qt4bKjrIjW+XyY0AAiIXp0AdJAlO/GqZv1S3uNkTiZJuf//tw3RjeJ5AaXM7APaHl9LljFK0mJPsRhp6Xfv3N9hVNkVfQo4JOr1Dq8x0li7pcHxW+E4VDDSkO4wZzgAEY= 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 1770067545019430.1073869128022; Mon, 2 Feb 2026 13:25:45 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id B57BB41AA6; Mon, 2 Feb 2026 16:25:43 -0500 (EST) Received: from [172.19.199.6] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 2F54041B1B; Mon, 2 Feb 2026 16:24:43 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 32C933FABD; Mon, 2 Feb 2026 16:24:38 -0500 (EST) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) (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 D9E124188B for ; Mon, 2 Feb 2026 16:24:36 -0500 (EST) Received: from mail-yw1-f198.google.com (mail-yw1-f198.google.com [209.85.128.198]) (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 smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id A4DA33F2D2 for ; Mon, 2 Feb 2026 21:24:34 +0000 (UTC) Received: by mail-yw1-f198.google.com with SMTP id 00721157ae682-79472373f48so74609007b3.3 for ; Mon, 02 Feb 2026 13:24:34 -0800 (PST) Received: from q0.lxd ([147.219.77.79]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-649c195cd7fsm4526629d50.15.2026.02.02.13.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Feb 2026 13:24:32 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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=canonical.com; s=20251003; t=1770067474; bh=btF7g0X5uBLofpzFu7Lnv8z/aT0l6GY64L0Zz5ItfPo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=PJM3ASf5vsTtWJZTIbUrwdRdvjhYOO/23/vdfns9wuUPv6naeNVY2wIGovHKLEzod ktmAXG4shMJIMX4bEjSJT3bOJev5qc942Ba8Wt2I8SRz1FDflQMOoTDMW3EtQM3Fd7 TVoudF/iYzy1OEdJg+xoP0WUpsWzCoqgE1IrZqytSvdCZ7B78tKbfKq0jjzwqT2ROq 9uDqjQbdwpds5vDQ1cywOKIdUU38aRc3JmOyDm9lahZ9s4+RnYmqzZQB8efAD8odVi 3gkkg2u4ud0du/JjM2tq6V6Hsq0OediUaLV2JxU9ZpD53yrh7qQTHxoxzlzIArFaob FCqsJvdCsya5NFLJQTFnln6VflIZRYt2N96FS+J/ZPQ+aiu/aqvvVCqfc2hwPPlRjg djS+b/WVCAT2vd69LYH1av7oDcswHHSUSS9ybBA3xiOz4LWfaBKu3gw0BMkLXTWf0X LDc1ipp1iDh6RijjFIby3IPzu1ZncDYz53M1lfBhNyyoHXD2lDIB/+JjDJjeiUQ1eV f7367dBaCCKkxI7eci3JpPWClELL4NXQgw9ID5zJXTddvNhUaixa1NtTsPvYRH2/H4 UcT9TKJKMTPlBkOc+Kv1pvSVIu8/4cz5bQR6Fwz636MnhIzfZ8CaZuQSgQfI1qXRy6 fT3V9W28XjhxfNOMECTmsNh4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770067473; x=1770672273; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=btF7g0X5uBLofpzFu7Lnv8z/aT0l6GY64L0Zz5ItfPo=; b=m4IKZxDCJoLqT+HRuPSXZ5xwpndZbMxUhiywHSob1cyjbkE/SmTuzvGv9tU2dcO4Ly 6/VhHL0vcD/rPNfo9YKi3w7CTgjT/kxTjRxY5pi890gl9LlnoBjzkiriQHXYf3ANNkKQ LvBqvZIEzrhpTbLhpXmfWdxQ90smKy9jGK4IMQagY3mr/ux9QPBYKTDgosGR10M3/ZRc FBN23sjFOPL0ek9KGBk/45Olp2s8XBbYbHzNsL6grPKacEcsff1Zk54J1RMIR6csIVdK lG6bLFYR83bKax0uo6Wu5Ncx0Tka/tQ37EfLmQigBOnm1YAooXqDqbQbpK/l330nXEph 0TiQ== X-Gm-Message-State: AOJu0YyN7qbs3UYPA6lWewQrLlayllSHO79YjnPUn5IsdGe5lRdhWAyQ zr3DB2SIuloiIRpZ1CPTU98WWxMyZ8ZsffkGJ4/VMU/e1/e4AEfX3GxCHGROcFyNW+bx0GjhPTG yFvNqblmhYDU5xXGUC1OPT9snRsYarg/SUyTiHZd0UuhEjkzeNgOB1WML1PMDPuqIhcK0U3cL2P M= X-Gm-Gg: AZuq6aKgCw4tDxIZYfzESRemVbi8I+7NeFRImeYkW/+rvABfsbNldJv3fNdfDT2mleB gy2JU6tvxuHKgv05Apd9hUwofuBYcCIvIJD1LGkacEB7aS8LDtJIjXgwV+ZlTv96D9dVLwc7vHa to09GUo40fHXyzoFiQCkVJnOM4pe0i4rdcoeDiyRpK2CB/2d/13ik4HaF4wHl2peh9sB7+M/k6d 2IasJh4v8CNJB1uDzkpmccSQGVw9q3/JiHItjq7Tx0V3OgS5BPozQRZSbuHrYNdeuSJpLtfQGj3 lRBEmGC0RmMY3b0yrlrhx0eIaADGfOTVNmznfPrj3oEY324FRBFPe4m6WV31vKX98H1Ukug19jk Y2oipl6b0Y00sd9OoMQ== X-Received: by 2002:a05:690e:168b:b0:649:c1f7:9e10 with SMTP id 956f58d0204a3-649c1f79eb9mr3787934d50.8.1770067473533; Mon, 02 Feb 2026 13:24:33 -0800 (PST) X-Received: by 2002:a05:690e:168b:b0:649:c1f7:9e10 with SMTP id 956f58d0204a3-649c1f79eb9mr3787919d50.8.1770067473114; Mon, 02 Feb 2026 13:24:33 -0800 (PST) Date: Mon, 02 Feb 2026 15:24:16 -0600 Subject: [PATCH v2] qemu: Store tapfd path in domstatus XML MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260202-apparmor-races-v2-1-ddebcfe832d2@canonical.com> X-B4-Tracking: v=1; b=H4sIAAAWgWkC/3XMyw7CIBCF4VdpZi1mAG905XuYLhCmdhILzWAaT dN3F7t3+Z/kfAsUEqYCbbOA0MyFc6phdg2EwacHKY61waA5ocaj8tPkZcyixAcqKqI19kJ0iM5 CPU1CPb838NbVHri8snw2f9a/9S81a4XKWRN6JOfwfr4Gn3Li4J/7kEfo1nX9AvdIgGywAAAA X-Change-ID: 20260105-apparmor-races-d03238ee4d93 To: devel@lists.libvirt.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=12652; i=wesley.hershberger@canonical.com; h=from:subject:message-id; bh=Pkrn0oJ1Wv9xnLVFmkht9ilGviU5qq/lPoyFpy4rml8=; b=owEB7QES/pANAwAKAfkogKziOh25AcsmYgBpgRYPCv4Lx8YW5strqez79cw7ChDeM6GeqkPLY PTMS0LTxf6JAbMEAAEKAB0WIQQsIHxFLwpehxEbQ8r5KICs4joduQUCaYEWDwAKCRD5KICs4jod ud56DADTV/zINWcZ+ls3tTPq1diajYO6JzfLpxbRc/OLeRTMrsAL6w8r+euW8OdTgywbD2/pbEM okAhzy8O6SEAlALbfTIGkmsBEVVep7UA3260eoTiqKSP1h2oChcWZqbjDATx1OdH+XETGiBPguO TsDX7klmbwIRsyfaOIDfUQ89GfNp5kF5jpgenwbpmLeXeJarp7NXoQimLXuOvgpPVC2nZLUE8PB UGZ1QOS7y6GxPE/YpDW6Ak1VK7G0MLUX0wezfK+EEEMR8Qr+qq4fXdsm/EGINsgjLP1ksNNof1K PJF/sQbkVIOI4R2DsLGJk4Do6ZLCF+rmSgMPNK8dhf9+2HbG8G8iLhs8WndVXg8LF5aSRFvv6/n ROAtg+y1FfJfJ9pqAhS6WVnBJ6FAWElES5rej4tUQKf1upPdkYlun8ZekIOJ1W4CnT/lfPG3oxr h6Km5/v+BhdCHjCj2pt4ryQuR+HBpb0SFoCB6+w/Gu7MEtGM7KzYpXQa+OHRJR3tf8k2s= X-Developer-Key: i=wesley.hershberger@canonical.com; a=openpgp; fpr=2C207C452F0A5E87111B43CAF92880ACE23A1DB9 Message-ID-Hash: IPEBLU63JTLWMHZZDEP3KQ6AMVC53VKR X-Message-ID-Hash: IPEBLU63JTLWMHZZDEP3KQ6AMVC53VKR X-MailFrom: wesley.hershberger@canonical.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 CC: wesley.hershberger@canonical.com, georgia.garcia@canonical.com, hector.cao@canonical.com 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: Wesley Hershberger via Devel Reply-To: Wesley Hershberger X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1770067548521158500 Introduce a read-only `tapfd` element for direct interfaces (macvtap), which contains the path to the backing tapfd for that interface (e.g. `/dev/tapXX`). The element is only included when the domain is being formatted for internal consumption (VIR_DOMAIN_DEF_FORMAT_STATUS) and is not accepted in user-provided XML (!VIR_DOMAIN_DEF_PARSE_INACTIVE). This is used by the AppArmor security driver when re-generating profiles. Partial-Resolves: #692 Bug-Ubuntu: https://bugs.launchpad.net/bugs/2126574 Signed-off-by: Wesley Hershberger --- This submission is a partial revision of a previous series with a fix for the macvtap component of gitlab#692 [1][2]. I haven't had bandwidth to resolve the blockcommit component since the complexity there is somewhat higher (and is also lower priority for us). I kept the separate `tapfd` element rather than reusing the existing `backend` element (virDomainNetBackend.tap) to avoid making a user-visible change [3]. I'd be happy to use the existing field instead if you think that would make more sense. I opted not to introduce/modify a security driver API for FD+path as the patch here is sufficient to resolve the bug, but would be willing to do so if that would make this change more palatable. I've opened a MR to libvirt-tck with test cases that demonstrate the bugs that this fixes [4]. apparmor/110-macvtap.t passes with this patch applied. Thanks for the reviews and continued consideration. ~Wesley [1] https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/= UNNBQCMTOCLILQFBDG75734OCQZIXWQF/ [2] https://gitlab.com/libvirt/libvirt/-/issues/692 [3] https://libvirt.org/formatdomain.html#setting-network-backend-specific-= options [4] https://gitlab.com/libvirt/libvirt-tck/-/merge_requests/73 --- Changes in v2: - Drop `virt-aa-helper: Ask for no deny rule...` as it was applied - Drop `qemu: Store blockcommit permissions...` due to unresolved concerns - Pass tapfd path through netdef instead of resolving from fd - Link to v1: https://lore.kernel.org/r/20260105-apparmor-races-v1-0-932cf0= e990b7@canonical.com --- src/conf/domain_conf.c | 8 ++++++++ src/conf/domain_conf.h | 1 + src/hypervisor/domain_interface.c | 2 +- src/lxc/lxc_process.c | 1 + src/qemu/qemu_interface.c | 1 + src/security/security_apparmor.c | 1 + src/security/virt-aa-helper.c | 5 +++++ src/util/virnetdevmacvlan.c | 18 +++++++++++------- src/util/virnetdevmacvlan.h | 4 +++- 9 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 02e23f78667a775637c710b651ba5fc7a127226f..1d7921e0de6f097ffaf86a9197d= 629e67dc213d7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2939,6 +2939,7 @@ virDomainNetDefFree(virDomainNetDef *def) g_free(def->virtio); g_free(def->coalesce); g_free(def->sourceDev); + g_free(def->tapfdpath); =20 virNetDevIPInfoClear(&def->guestIP); virNetDevIPInfoClear(&def->hostIP); @@ -10440,6 +10441,10 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt, return NULL; } =20 + if (!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE)) { + def->tapfdpath =3D virXPathString("string(./tapfd/@path)", ctxt); + } + if (virNetworkPortOptionsParseXML(ctxt, &def->isolatedPort) < 0) return NULL; =20 @@ -25664,6 +25669,9 @@ virDomainNetDefFormat(virBuffer *buf, if (def->mtu) virBufferAsprintf(buf, "\n", def->mtu); =20 + if (def->tapfdpath && (flags & VIR_DOMAIN_DEF_FORMAT_STATUS)) + virBufferAsprintf(buf, "\n", def->tapfdpath); + virDomainNetDefCoalesceFormatXML(buf, def->coalesce); =20 virDomainDeviceInfoFormat(buf, &def->info, flags | VIR_DOMAIN_DEF_FORM= AT_ALLOW_BOOT diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 66dc4e3417b8cb5bce60217a4e529add61149962..ba2bf1f750dcd7f4f25ef3bf55f= d63629d3b5222 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1203,6 +1203,7 @@ struct _virDomainNetDef { char *downscript; char *domain_name; /* backend domain name */ char *ifname; /* interface name on the host () */ + char *tapfdpath; /* Path in /dev for macvtap () */ virTristateBool managed_tap; virNetDevIPInfo hostIP; char *ifname_guest_actual; diff --git a/src/hypervisor/domain_interface.c b/src/hypervisor/domain_inte= rface.c index 5bc698d2727e1142e9c5dc30ac00975f268f98e8..37e3d453a03943ee5729ad2d4b0= 87b5e0ca37408 100644 --- a/src/hypervisor/domain_interface.c +++ b/src/hypervisor/domain_interface.c @@ -111,7 +111,7 @@ virDomainInterfaceEthernetConnect(virDomainDef *def, =20 if (virNetDevMacVLanIsMacvtap(net->ifname)) { auditdev =3D net->ifname; - if (virNetDevMacVLanTapOpen(net->ifname, tapfd, tapfdSize) < 0) + if (virNetDevMacVLanTapOpen(net->ifname, tapfd, tapfdSize, &ne= t->tapfdpath) < 0) goto cleanup; if (virNetDevMacVLanTapSetup(tapfd, tapfdSize, virDomainInterfaceIsVnetCompatMod= el(net)) < 0) { diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index 1bca9e8daea2cb8f63bcf5c0a735252ff57af6f1..c731b28871b18329e633c42f214= 1d22063208d9f 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -379,6 +379,7 @@ virLXCProcessSetupInterfaceDirect(virLXCDriver *driver, VIR_NETDEV_VPORT_PROFILE_OP_CREATE, cfg->stateDir, NULL, 0, + &net->tapfdpath, macvlan_create_flags) < 0) return NULL; =20 diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c index 23a23d201aec31a36431646551ae03a233606e30..edc53d53b3b34afbfb8662e809b= c0898076fdfc5 100644 --- a/src/qemu/qemu_interface.c +++ b/src/qemu/qemu_interface.c @@ -81,6 +81,7 @@ qemuInterfaceDirectConnect(virDomainDef *def, &res_ifname, vmop, cfg->stateDir, tapfd, tapfdSize, + &net->tapfdpath, macvlan_create_flags) < 0) goto cleanup; =20 diff --git a/src/security/security_apparmor.c b/src/security/security_appar= mor.c index 934acfb46198401d84d47cc6266a9403eda5a3b0..dec271721641c811944f98464ce= bebca6ed6a159 100644 --- a/src/security/security_apparmor.c +++ b/src/security/security_apparmor.c @@ -157,6 +157,7 @@ load_profile(virSecurityManager *mgr G_GNUC_UNUSED, =20 if (virDomainDefFormatInternal(def, NULL, &buf, VIR_DOMAIN_DEF_FORMAT_SECURE | + VIR_DOMAIN_DEF_FORMAT_STATUS | VIR_DOMAIN_DEF_FORMAT_VOLUME_TRANSLATED= ) < 0) return -1; =20 diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index f4ec6b7826ba532f0dbac2dcd4ed89f7f98e6be6..e904d5e8292ae5e7d4acbec2062= a91861a9535f5 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -1176,6 +1176,11 @@ get_files(vahControl * ctl) vhu->type) !=3D 0) return -1; } + + if (net->tapfdpath) { + if (vah_add_file(&buf, net->tapfdpath, "rwk") !=3D 0) + return -1; + } } =20 for (i =3D 0; i < ctl->def->nmems; i++) { diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index cde9d70eefd047dc5c16056f6697cf4d05bc0795..fcf63e08ff07eca22a122a2532c= ea1b0c9a95c9e 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -152,24 +152,24 @@ int virNetDevMacVLanDelete(const char *ifname) int virNetDevMacVLanTapOpen(const char *ifname, int *tapfd, - size_t tapfdSize) + size_t tapfdSize, + char **tapname) { int retries =3D 10; int ret =3D -1; int ifindex; size_t i =3D 0; - g_autofree char *tapname =3D NULL; =20 if (virNetDevGetIndex(ifname, &ifindex) < 0) return -1; =20 - tapname =3D g_strdup_printf("/dev/tap%d", ifindex); + *tapname =3D g_strdup_printf("/dev/tap%d", ifindex); =20 for (i =3D 0; i < tapfdSize; i++) { int fd =3D -1; =20 while (fd < 0) { - if ((fd =3D open(tapname, O_RDWR)) >=3D 0) { + if ((fd =3D open(*tapname, O_RDWR)) >=3D 0) { tapfd[i] =3D fd; } else if (retries-- > 0) { /* may need to wait for udev to be done */ @@ -178,7 +178,7 @@ virNetDevMacVLanTapOpen(const char *ifname, /* However, if haven't succeeded, quit. */ virReportSystemError(errno, _("cannot open macvtap tap device %1$= s"), - tapname); + *tapname); goto cleanup; } } @@ -188,6 +188,7 @@ virNetDevMacVLanTapOpen(const char *ifname, =20 cleanup: if (ret < 0) { + g_free(*tapname); while (i--) VIR_FORCE_CLOSE(tapfd[i]); } @@ -659,6 +660,7 @@ virNetDevMacVLanCreateWithVPortProfile(const char *ifna= meRequested, char *stateDir, int *tapfd, size_t tapfdSize, + char **tapfdpath, unsigned int flags) { g_autofree char *ifname =3D NULL; @@ -729,7 +731,7 @@ virNetDevMacVLanCreateWithVPortProfile(const char *ifna= meRequested, } =20 if (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) { - if (virNetDevMacVLanTapOpen(ifname, tapfd, tapfdSize) < 0) + if (virNetDevMacVLanTapOpen(ifname, tapfd, tapfdSize, tapfdpath) <= 0) goto disassociate_exit; =20 if (virNetDevMacVLanTapSetup(tapfd, tapfdSize, vnet_hdr) < 0) @@ -888,7 +890,8 @@ int virNetDevMacVLanDelete(const char *ifname G_GNUC_UN= USED) int virNetDevMacVLanTapOpen(const char *ifname G_GNUC_UNUSED, int *tapfd G_GNUC_UNUSED, - size_t tapfdSize G_GNUC_UNUSED) + size_t tapfdSize G_GNUC_UNUSED, + char **tapname G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("Cannot create macvlan devices on this platform= ")); @@ -917,6 +920,7 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *= ifname G_GNUC_UNUSED, char *stateDir G_GNUC_UNUSED, int *tapfd G_GNUC_UNUSED, size_t tapfdSize G_GNUC_UNUSED, + char **tapfdpath G_GNUC_UNUSED, unsigned int unused_flags G_GNU= C_UNUSED) { virReportSystemError(ENOSYS, "%s", diff --git a/src/util/virnetdevmacvlan.h b/src/util/virnetdevmacvlan.h index 31e4804cdc0d7c4beb74ba66d204d0ff7ad83151..7424b8796529d6c6d1909eee81c= 88e8ded0ea84b 100644 --- a/src/util/virnetdevmacvlan.h +++ b/src/util/virnetdevmacvlan.h @@ -72,13 +72,15 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *= ifname, char *stateDir, int *tapfd, size_t tapfdSize, + char **tapfdpath, unsigned int flags) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(6) ATTRIBUTE_NONNULL(8) ATTRIBUTE_NONNULL(10) G_GNUC_WARN_UNUSED_RESULT; =20 int virNetDevMacVLanTapOpen(const char *ifname, int *tapfd, - size_t tapfdSize) + size_t tapfdSize, + char **tapname) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; =20 --- base-commit: 74fc02d792f7ee55d2e0a7b9ad4e6d751c36ceb8 change-id: 20260105-apparmor-races-d03238ee4d93 Best regards, --=20 Wesley Hershberger