qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: Fabiano Rosas <farosas@suse.de>,
	peterx@redhat.com, Juraj Marcin <jmarcin@redhat.com>
Subject: [PULL 8/9] tests/migration-test: Add MEM_TYPE_SHMEM
Date: Fri, 21 Nov 2025 19:26:54 -0500	[thread overview]
Message-ID: <20251122002656.687350-9-peterx@redhat.com> (raw)
In-Reply-To: <20251122002656.687350-1-peterx@redhat.com>

Add memfd support for mem_type.  Will be used to replace memory_backend.

Reviewed-by: Juraj Marcin <jmarcin@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20251117223908.415965-4-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 tests/qtest/migration/framework.h | 13 +++++++++++++
 tests/qtest/migration/framework.c |  3 +++
 2 files changed, 16 insertions(+)

diff --git a/tests/qtest/migration/framework.h b/tests/qtest/migration/framework.h
index 70705725bc..9dec21c344 100644
--- a/tests/qtest/migration/framework.h
+++ b/tests/qtest/migration/framework.h
@@ -19,8 +19,21 @@
 #define FILE_TEST_MARKER 'X'
 
 typedef enum {
+    /*
+     * Use memory-backend-ram, private mappings
+     */
     MEM_TYPE_ANON,
+    /*
+     * Use shmem file (under /dev/shm), shared mappings
+     */
     MEM_TYPE_SHMEM,
+    /*
+     * Use anonymous memfd, shared mappings.
+     *
+     * NOTE: this is internally almost the same as MEM_TYPE_SHMEM on Linux,
+     * but only anonymously allocated.
+     */
+    MEM_TYPE_MEMFD,
     MEM_TYPE_NUM,
 } MemType;
 
diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/framework.c
index 7f325e4753..1c662f86a9 100644
--- a/tests/qtest/migration/framework.c
+++ b/tests/qtest/migration/framework.c
@@ -280,6 +280,9 @@ static char *migrate_mem_type_get_opts(MemType type, const char *memory_size)
         backend = g_strdup_printf("-object memory-backend-file,mem-path=%s",
                                   shmem_path);
         break;
+    case MEM_TYPE_MEMFD:
+        backend = g_strdup("-object memory-backend-memfd");
+        break;
     default:
         g_assert_not_reached();
         break;
-- 
2.50.1



  parent reply	other threads:[~2025-11-22  2:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-22  0:26 [PULL 0/9] Staging patches Peter Xu
2025-11-22  0:26 ` [PULL 1/9] migration: Fix transition to COLO state from precopy Peter Xu
2025-11-22  0:26 ` [PULL 2/9] migration: set correct list pointer when removing notifier Peter Xu
2025-11-22  0:26 ` [PULL 3/9] migration: Plug memory leaks after migrate_set_error() Peter Xu
2025-11-22  0:26 ` [PULL 4/9] migration: Use warn_reportf_err() where appropriate Peter Xu
2025-11-22  0:26 ` [PULL 5/9] migration/postcopy-ram: Improve error reporting after loadvm failure Peter Xu
2025-11-22  0:26 ` [PULL 6/9] tests/migration-test: Introduce MemType Peter Xu
2025-11-22  0:26 ` [PULL 7/9] tests/migration-test: Merge shmem_opts into memory_backend Peter Xu
2025-11-22  0:26 ` Peter Xu [this message]
2025-11-22  0:26 ` [PULL 9/9] tests/migration-test: Use MEM_TYPE_MEMFD for memory_backend Peter Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251122002656.687350-9-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=farosas@suse.de \
    --cc=jmarcin@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).