tests/migration-test: Add MEM_TYPE_SHMEM
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>
This commit is contained in:
parent
b1d67d86db
commit
c2f2470e31
2 changed files with 16 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue