On Thu, Sep 24, 2026 at 08:43:06PM -0500, Michael Roth wrote:
> v1: https://lore.kernel.org/r/[email protected]
> v2: https://lore.kernel.org/r/[email protected]
> v3: https://lore.kernel.org/r/[email protected]/
> v4: 
> https://lore.kernel.org/qemu-devel/[email protected]/
> v5: 
> https://lore.kernel.org/qemu-devel/[email protected]/
> v6:
> - Rename the hostmem property to 'x-guest-memfd' since initial users
>   are expected to be developers or early enablers (Markus)
> - Introduce accompanying 'guest-memfd' RST doc and reference it in
>   the QAPI schema documentation for x-guest-memfd (Markus)
> - Move all renaming patches toward beginning of the series for
>   consistency (David)
> - Fix mispellings in commit messages (David)
> - Drop ramlist lock in new ram_block_add() error path
> - Collect Reviewed-by's
> - Rebase on QEMU master

Michael,

Sorry, I missed your very last discussion with Markus..  only notice until
I saw the repost.  I agree we can mark it experimental, but just to mention
we should have moved to use "unstable" rather than prefix "x-", then we
don't need to bother with the ABI change, see:

    commit a3c45b3e62962f99338716b1347cfb0d427cea44
    Author: Markus Armbruster <[email protected]>
    Date:   Thu Oct 28 12:25:12 2021 +0200

    qapi: New special feature flag "unstable"

No need for another repost, I can manage that with two fixups when queue,
please shoot if there's any objections.  Attached at the end.

Thanks,

===8<===
>From 94884f136d9d42044e3f4cfcf440df8016ad3e99 Mon Sep 17 00:00:00 2001
From: Peter Xu <[email protected]>
Date: Fri, 25 Sep 2026 08:51:13 -0400
Subject: [PATCH 1/2] fixup! hostmem: Support fully shared guest memfd to back
 a VM

Signed-off-by: Peter Xu <[email protected]>
---
 docs/system/guest-memfd.rst |  4 ++--
 qapi/qom.json               |  9 +++++++--
 backends/hostmem-memfd.c    | 10 +++++-----
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/docs/system/guest-memfd.rst b/docs/system/guest-memfd.rst
index f7cef19283..d62a214a91 100644
--- a/docs/system/guest-memfd.rst
+++ b/docs/system/guest-memfd.rst
@@ -38,10 +38,10 @@ exposed by QEMU command-line options.
 For non-Confidential guests, guest-memfd can be used in a manner that
 is somewhat interchangeable with a normal memfd. Currently, this is
 handled by using the same memory-backend implementation as memfd, but
-with an additional 'x-guest-memfd=on' option. E.g.::
+with an additional 'guest-memfd=on' option. E.g.::
 
     qemu ... \
-      -object memory-backend-memfd,id=ID,size=SIZE,share=on,x-guest-memfd=on
+      -object memory-backend-memfd,id=ID,size=SIZE,share=on,guest-memfd=on
 
 Note that the share=on option is required for guest-memfd, since it
 does not support anonymous memory allocations or COW-like semantics.
diff --git a/qapi/qom.json b/qapi/qom.json
index 602b17ad83..7423acea8f 100644
--- a/qapi/qom.json
+++ b/qapi/qom.json
@@ -780,10 +780,14 @@
 # @seal: if true, create a sealed-file, which will block further
 #     resizing of the memory (default: true)
 #
-# @x-guest-memfd: if 'on', use guest-memfd to back the memory region.
+# @guest-memfd: if 'on', use guest-memfd to back the memory region.
 #     See the "guest-memfd" QEMU documentation for more details.
 #     (default: auto, since: 11.2)
 #
+# Features:
+#
+# @unstable: Member @guest-memfd is experimental.
+#
 # Since: 2.12
 ##
 { 'struct': 'MemoryBackendMemfdProperties',
@@ -791,7 +795,8 @@
   'data': { '*hugetlb': 'bool',
             '*hugetlbsize': 'size',
             '*seal': 'bool',
-            '*x-guest-memfd': 'OnOffAuto' },
+            '*guest-memfd': { 'type': 'OnOffAuto',
+                              'features': [ 'unstable' ] } },
   'if': 'CONFIG_LINUX' }
 
 ##
diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c
index a164bb659f..666593ff6c 100644
--- a/backends/hostmem-memfd.c
+++ b/backends/hostmem-memfd.c
@@ -59,14 +59,14 @@ memfd_backend_memory_alloc(HostMemoryBackend *backend, 
Error **errp)
 
     if (m->guest_memfd == ON_OFF_AUTO_ON) {
         /*
-         * NOTE: x-guest-memfd ignores seal=on/off because it always
+         * NOTE: guest-memfd ignores seal=on/off because it always
          * implicitly seals the FD by definition.
          */
         if (!backend->share) {
-            error_setg(errp, "x-guest-memfd=on must be used with share=on");
+            error_setg(errp, "guest-memfd=on must be used with share=on");
             return false;
         } else if (m->hugetlb) {
-            error_setg(errp, "x-guest-memfd=on doesn't support hugetlb=on");
+            error_setg(errp, "guest-memfd=on doesn't support hugetlb=on");
             return false;
         }
 
@@ -203,10 +203,10 @@ memfd_backend_class_init(ObjectClass *oc, const void 
*data)
                                               "Huge pages size (ex: 2M, 1G)");
     }
 
-    object_class_property_add(oc, "x-guest-memfd", "OnOffAuto",
+    object_class_property_add(oc, "guest-memfd", "OnOffAuto",
                               memfd_backend_get_guest_memfd,
                               memfd_backend_set_guest_memfd, NULL, NULL);
-    object_class_property_set_description(oc, "x-guest-memfd",
+    object_class_property_set_description(oc, "guest-memfd",
                                           "Use guest memfd");
 
     object_class_property_add_bool(oc, "seal",
-- 
2.55.0


>From efb5a9d33373e0dcedbfec3dce28844164ccb8c8 Mon Sep 17 00:00:00 2001
From: Peter Xu <[email protected]>
Date: Fri, 25 Sep 2026 08:51:26 -0400
Subject: [PATCH 2/2] fixup! tests/migration-test: Support guest-memfd init
 shared mem type

Signed-off-by: Peter Xu <[email protected]>
---
 tests/qtest/migration/framework.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qtest/migration/framework.c 
b/tests/qtest/migration/framework.c
index 93225e3720..b7aef6b21c 100644
--- a/tests/qtest/migration/framework.c
+++ b/tests/qtest/migration/framework.c
@@ -301,7 +301,7 @@ static char *migrate_mem_type_get_opts(MemType type, const 
char *memory_size)
         backend = g_strdup("-object memory-backend-memfd");
         break;
     case MEM_TYPE_GUEST_MEMFD:
-        backend = g_strdup("-object memory-backend-memfd,x-guest-memfd=on");
+        backend = g_strdup("-object memory-backend-memfd,guest-memfd=on");
         break;
     default:
         g_assert_not_reached();
-- 
2.55.0



-- 
Peter Xu


Reply via email to