]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/migration-test: Add MEM_TYPE_SHMEM
authorPeter Xu <peterx@redhat.com>
Mon, 17 Nov 2025 22:39:07 +0000 (17:39 -0500)
committerPeter Xu <peterx@redhat.com>
Sat, 22 Nov 2025 00:23:30 +0000 (19:23 -0500)
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.c
tests/qtest/migration/framework.h

index 7f325e47538e52256538913d27a42cdd9a0c5e45..1c662f86a93eb73fa938223a6aeb38f80b9aa3a2 100644 (file)
@@ -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;
index 70705725bc2c7a8d72cdbdafefc2115b5dae1503..9dec21c344291ed03d56528561e1b22058744c1d 100644 (file)
 #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;