From nobody Sun Jul 26 05:50:11 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1783423350; cv=none; d=zohomail.com; s=zohoarc; b=d7jiBZx0iEHIXOzFJ7vLfwd75qyKyyDWwkcM/KvPw4L7LcweXuKaAgwQhFR13jyv/XUxt16pS2iVwKdS62L6akeqv7k9GhgRBbT/neL8kaXyDga87f7n6LHeYd8Z9WbU8LzXEsZ0bdT4Yj/F63S2hFdC2XXxs6TwnszbZuyCK9Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783423350; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kRrs0HRsKSbo6dcjE3r/xJZpFw5kDBz3/cHORzsSx/w=; b=LTwo4rCuEh9yUIllPL8xipGQhwqXP4+ksCLRJ824gSOK9GWYrxOwY3pto6yweHNDNy/qRpNBKMI0gYXsYFpDHZdyKqoMiQYQiLzPI9wyzvljvA8DWot5QVV29UwfB1HQoD++33aF39m36ipZvOVj6oZHMZJK6DLi4ol7tkmDbVM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783423350486327.9977616186012; Tue, 7 Jul 2026 04:22:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wh3sK-0002D4-Lk; Tue, 07 Jul 2026 07:22:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wh3sI-0002Ch-NU for qemu-devel@nongnu.org; Tue, 07 Jul 2026 07:22:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wh3sH-0002pU-91 for qemu-devel@nongnu.org; Tue, 07 Jul 2026 07:22:02 -0400 Received: from mx-prod-mc-05.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-97--Njy3vM5OEqv0efZx9JdOw-1; Tue, 07 Jul 2026 07:21:58 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 56B1D1954AEC for ; Tue, 7 Jul 2026 11:21:57 +0000 (UTC) Received: from fedora (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3731E1800747; Tue, 7 Jul 2026 11:21:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783423319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kRrs0HRsKSbo6dcjE3r/xJZpFw5kDBz3/cHORzsSx/w=; b=TdrcWR70yLmORsxFab+6GBiknkknlAS4nzadUx9I8Fh0aHslz4NwfQ61R4Rnxjb1JW47l7 V0xj3OmBZxfgzvOVxR+0UVK/phsAG85l/kr+cxR8GY5sFsh4Tgr9Fd86yOvuSwxhhozNAy xBlfxysZnGdnH7f2dHjZO55k2VDylxQ= X-MC-Unique: -Njy3vM5OEqv0efZx9JdOw-1 X-Mimecast-MFC-AGG-ID: -Njy3vM5OEqv0efZx9JdOw_1783423317 From: Albert Esteve To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Stefano Garzarella , Albert Esteve Subject: [PATCH 1/2] virtio: add shmem map transaction wrappers Date: Tue, 7 Jul 2026 13:21:48 +0200 Message-ID: <20260707112149.2867886-2-aesteve@redhat.com> In-Reply-To: <20260707112149.2867886-1-aesteve@redhat.com> References: <20260707112149.2867886-1-aesteve@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=aesteve@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1783423351500158500 Content-Type: text/plain; charset="utf-8" Introduce virtio_add_shmem_map_start() and virtio_add_shmem_map_end() as wrappers around memory_region_transaction_begin() and memory_region_transaction_commit(). This keeps memory subsystem calls out of vhost-user.c and gives the transaction pair a name that reflects its purpose: delaying the commit until after a reply has been sent to the vhost-user backend. Signed-off-by: Albert Esteve --- hw/virtio/vhost-user.c | 6 +++--- hw/virtio/virtio.c | 10 ++++++++++ include/hw/virtio/virtio.h | 17 +++++++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 517cc4ca71..f6bf9e0ba4 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -1977,7 +1977,7 @@ vhost_user_backend_handle_shmem_map(struct vhost_dev = *dev, } } =20 - memory_region_transaction_begin(); + virtio_add_shmem_map_start(); =20 /* Create VirtioSharedMemoryMapping object */ VirtioSharedMemoryMapping *mapping =3D virtio_shared_memory_mapping_ne= w( @@ -2004,11 +2004,11 @@ send_reply_commit: hdr->size =3D sizeof(payload->u64); if (!vhost_user_send_resp(ioc, hdr, payload, &local_err)) { error_report_err(local_err); - memory_region_transaction_commit(); + virtio_add_shmem_map_end(); return -EFAULT; } } - memory_region_transaction_commit(); + virtio_add_shmem_map_end(); return 0; =20 send_reply: diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index f4d86a3655..e604781ffe 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -3226,6 +3226,16 @@ VirtioSharedMemoryMapping *virtio_shared_memory_mapp= ing_new(uint8_t shmid, return mapping; } =20 +void virtio_add_shmem_map_start(void) +{ + memory_region_transaction_begin(); +} + +void virtio_add_shmem_map_end(void) +{ + memory_region_transaction_commit(); +} + int virtio_add_shmem_map(VirtioSharedMemory *shmem, VirtioSharedMemoryMapping *mapping) { diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index c99cb19d88..9935452486 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -390,6 +390,23 @@ VirtioSharedMemoryMapping *virtio_shared_memory_mappin= g_new(uint8_t shmid, uint64_t len, bool allow_wri= te); =20 +/** + * virtio_add_shmem_map_start() - Begin a shmem map transaction + * + * Begins a transaction to add a shared memory mapping. Call this before a= dding + * a shared memory mapping when the commit must be delayed until after a r= eply + * is sent to a vhost-user backend. + */ +void virtio_add_shmem_map_start(void); + +/** + * virtio_add_shmem_map_end() - End a shmem map transaction + * + * Completes the transaction started by virtio_add_shmem_map_start() and m= akes + * the mapping visible to the guest. + */ +void virtio_add_shmem_map_end(void); + /** * virtio_add_shmem_map() - Add a memory mapping to a shared region * @shmem: VirtioSharedMemory region --=20 2.54.0 From nobody Sun Jul 26 05:50:11 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1783423352; cv=none; d=zohomail.com; s=zohoarc; b=Z0zYdg6tCw+fbNhYRZlOAlW0PzMfahyi8jNrqfvROUDo2hmzTq1rz7v2eqByCWYU5h4VnG74o/hx53LbI3V0mEWSOSC21+QzY6D+siEFpdfXB2p2uVEZ8TpRf//pGprPbIg2CzwjEMMjXKlBJ2SRp3nyrESJ88umDjZIE+OGYak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783423352; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=61wZAldU9pmQB81HUAvBNMJ/a4cqp9X8nZD/50zn2FM=; b=i9A+2yf4tdl4/pPVKLgHGDjWE5xfpcwijudkOgVDs79xG4oHJNX1J3KZQHkYtCn7i8dRbyqB9Q4QtTpxjp1X0uVjKbHaoTabDyF3ckPCQ8FYXYwkiVFybLPBMo2A/tForwogM2y8y2ZWkGlT9n/aya6PbMsasJWoaWodBuTCok8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783423352770974.7969489625511; Tue, 7 Jul 2026 04:22:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wh3sP-0002IL-1S; Tue, 07 Jul 2026 07:22:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wh3sK-0002D5-21 for qemu-devel@nongnu.org; Tue, 07 Jul 2026 07:22:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wh3sI-0002sO-6X for qemu-devel@nongnu.org; Tue, 07 Jul 2026 07:22:03 -0400 Received: from mx-prod-mc-05.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-52-k1mFv6jxNYifYCuc-fUcSw-1; Tue, 07 Jul 2026 07:21:59 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F38DB1954AF5 for ; Tue, 7 Jul 2026 11:21:58 +0000 (UTC) Received: from fedora (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DB699180067C; Tue, 7 Jul 2026 11:21:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783423321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=61wZAldU9pmQB81HUAvBNMJ/a4cqp9X8nZD/50zn2FM=; b=TmrOFF4t9KQ1DedssjmmzaEpd3nkZGzFK8iJFrlBDmyjruiwR59/VGaPqoAGA7hAtZr7uj 0GgF8kR29EpLprDjTHzKj8e/o5ySFpKKSJDXFexo9c8LonaTGfvK3lOVapg3BPVAauKn29 saSvq9MmvlxnU18ID/NlKqDuIvlkKQM= X-MC-Unique: k1mFv6jxNYifYCuc-fUcSw-1 X-Mimecast-MFC-AGG-ID: k1mFv6jxNYifYCuc-fUcSw_1783423319 From: Albert Esteve To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Stefano Garzarella , Albert Esteve Subject: [PATCH 2/2] virtio: use g_autoptr guard for shmem map transaction Date: Tue, 7 Jul 2026 13:21:49 +0200 Message-ID: <20260707112149.2867886-3-aesteve@redhat.com> In-Reply-To: <20260707112149.2867886-1-aesteve@redhat.com> References: <20260707112149.2867886-1-aesteve@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=aesteve@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1783423353405158500 Content-Type: text/plain; charset="utf-8" Use g_autoptr(VirtioShmemGuard) to automatically commit the memory region transaction opened by virtio_add_shmem_map_start(), removing explicit virtio_add_shmem_map_end() calls on each exit path of vhost_user_backend_handle_shmem_map(). This also allows the send_reply_commit label to be folded into send_reply since the two blocks are now identical. VirtioShmemGuard is a sentinel type whose non-NULL value triggers the cleanup function on scope exit via GLib's g_autoptr infrastructure, similar to those used in main-loop.h and rcu.h. Signed-off-by: Albert Esteve --- hw/virtio/vhost-user.c | 21 ++++----------------- hw/virtio/virtio.c | 4 +++- include/hw/virtio/virtio.h | 16 ++++++++++++++-- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index f6bf9e0ba4..0306b06b48 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -1933,6 +1933,7 @@ vhost_user_backend_handle_shmem_map(struct vhost_dev = *dev, VhostUserPayload *payload, int fd) { + g_autoptr(VirtioShmemGuard) shmem_guard =3D NULL; VirtioSharedMemory *shmem; VhostUserMMap *vu_mmap =3D &payload->mmap; VirtioSharedMemoryMapping *existing; @@ -1977,7 +1978,7 @@ vhost_user_backend_handle_shmem_map(struct vhost_dev = *dev, } } =20 - virtio_add_shmem_map_start(); + shmem_guard =3D virtio_add_shmem_map_start(); =20 /* Create VirtioSharedMemoryMapping object */ VirtioSharedMemoryMapping *mapping =3D virtio_shared_memory_mapping_ne= w( @@ -1986,7 +1987,7 @@ vhost_user_backend_handle_shmem_map(struct vhost_dev = *dev, =20 if (!mapping) { ret =3D -EFAULT; - goto send_reply_commit; + goto send_reply; } =20 /* Add the mapping to the shared memory region */ @@ -1994,22 +1995,8 @@ vhost_user_backend_handle_shmem_map(struct vhost_dev= *dev, error_report("Failed to add shared memory mapping"); object_unref(OBJECT(mapping)); ret =3D -EFAULT; - goto send_reply_commit; - } - -send_reply_commit: - /* Send reply and commit after transaction started */ - if (hdr->flags & VHOST_USER_NEED_REPLY_MASK) { - payload->u64 =3D !!ret; - hdr->size =3D sizeof(payload->u64); - if (!vhost_user_send_resp(ioc, hdr, payload, &local_err)) { - error_report_err(local_err); - virtio_add_shmem_map_end(); - return -EFAULT; - } + goto send_reply; } - virtio_add_shmem_map_end(); - return 0; =20 send_reply: if (hdr->flags & VHOST_USER_NEED_REPLY_MASK) { diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index e604781ffe..1db800fcd7 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -3226,9 +3226,11 @@ VirtioSharedMemoryMapping *virtio_shared_memory_mapp= ing_new(uint8_t shmid, return mapping; } =20 -void virtio_add_shmem_map_start(void) +VirtioShmemGuard *virtio_add_shmem_map_start(void) { memory_region_transaction_begin(); + /* Anything non-NULL causes the cleanup function to be called */ + return (VirtioShmemGuard *)(uintptr_t)1; } =20 void virtio_add_shmem_map_end(void) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 9935452486..b9e67f789c 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -104,6 +104,8 @@ enum virtio_device_endian { #define TYPE_VIRTIO_SHARED_MEMORY_MAPPING "virtio-shared-memory-mapping" OBJECT_DECLARE_SIMPLE_TYPE(VirtioSharedMemoryMapping, VIRTIO_SHARED_MEMORY= _MAPPING) =20 +typedef void VirtioShmemGuard; + /** * VirtioSharedMemoryMapping: * @parent: Parent QOM object @@ -396,17 +398,27 @@ VirtioSharedMemoryMapping *virtio_shared_memory_mappi= ng_new(uint8_t shmid, * Begins a transaction to add a shared memory mapping. Call this before a= dding * a shared memory mapping when the commit must be delayed until after a r= eply * is sent to a vhost-user backend. + * + * Returns: Non-NULL guard that triggers cleanup on scope exit. */ -void virtio_add_shmem_map_start(void); +VirtioShmemGuard *virtio_add_shmem_map_start(void); =20 /** * virtio_add_shmem_map_end() - End a shmem map transaction * * Completes the transaction started by virtio_add_shmem_map_start() and m= akes - * the mapping visible to the guest. + * the mapping visible to the guest. Prefer using g_autoptr(VirtioShmemGua= rd) + * over calling this directly. */ void virtio_add_shmem_map_end(void); =20 +static inline void virtio_shmem_guard_cleanup(VirtioShmemGuard *guard) +{ + virtio_add_shmem_map_end(); +} + +G_DEFINE_AUTOPTR_CLEANUP_FUNC(VirtioShmemGuard, virtio_shmem_guard_cleanup) + /** * virtio_add_shmem_map() - Add a memory mapping to a shared region * @shmem: VirtioSharedMemory region --=20 2.54.0