tests/migration-test: Use MEM_TYPE_MEMFD for memory_backend
The only two users of memory_backend as of now (cpr-exec, cpr-transfer) uses memfd as backend, now we fully support it. We can move memory_backend usage to mem_type and drop it. Reviewed-by: Juraj Marcin <jmarcin@redhat.com> Reviewed-by: Fabiano Rosas <farosas@suse.de> Link: https://lore.kernel.org/r/20251117223908.415965-5-peterx@redhat.com Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
c2f2470e31
commit
6aef825073
3 changed files with 5 additions and 16 deletions
|
|
@ -89,8 +89,7 @@ static void test_mode_transfer_common(bool incoming_defer)
|
|||
.start.opts_source = opts,
|
||||
.start.opts_target = opts_target,
|
||||
.start.defer_target_connect = true,
|
||||
.start.memory_backend = "-object memory-backend-memfd,id=pc.ram,size=%s"
|
||||
" -machine memory-backend=pc.ram",
|
||||
.start.mem_type = MEM_TYPE_MEMFD,
|
||||
.listen_uri = incoming_defer ? "defer" : uri,
|
||||
.connect_channels = connect_channels,
|
||||
.cpr_channel = cpr_channel,
|
||||
|
|
@ -235,8 +234,7 @@ static void test_mode_exec(void)
|
|||
MigrateCommon args = {
|
||||
.start.only_source = true,
|
||||
.start.opts_source = "-machine aux-ram-share=on -nodefaults",
|
||||
.start.memory_backend = "-object memory-backend-memfd,id=pc.ram,size=%s"
|
||||
" -machine memory-backend=pc.ram",
|
||||
.start.mem_type = MEM_TYPE_MEMFD,
|
||||
.connect_uri = uri,
|
||||
.listen_uri = listen_uri,
|
||||
.start_hook = test_mode_exec_start,
|
||||
|
|
|
|||
|
|
@ -366,13 +366,9 @@ int migrate_args(char **from, char **to, const char *uri, MigrateStart *args)
|
|||
ignore_stderr = "";
|
||||
}
|
||||
|
||||
if (args->memory_backend) {
|
||||
memory_backend = g_strdup_printf(args->memory_backend, memory_size);
|
||||
} else {
|
||||
mem_object = migrate_mem_type_get_opts(args->mem_type, memory_size);
|
||||
memory_backend = g_strdup_printf("-machine memory-backend=%s %s",
|
||||
MIG_MEM_ID, mem_object);
|
||||
}
|
||||
mem_object = migrate_mem_type_get_opts(args->mem_type, memory_size);
|
||||
memory_backend = g_strdup_printf("-machine memory-backend=%s %s",
|
||||
MIG_MEM_ID, mem_object);
|
||||
|
||||
if (args->use_dirty_ring) {
|
||||
kvm_opts = ",dirty-ring-size=4096";
|
||||
|
|
|
|||
|
|
@ -134,11 +134,6 @@ typedef struct {
|
|||
bool suspend_me;
|
||||
/* enable OOB QMP capability */
|
||||
bool oob;
|
||||
/*
|
||||
* Format string for the main memory backend, containing one %s where the
|
||||
* size is plugged in. If omitted, "-m %s" is used.
|
||||
*/
|
||||
const char *memory_backend;
|
||||
|
||||
/* Do not connect to target monitor and qtest sockets in qtest_init */
|
||||
bool defer_target_connect;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue