mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
migration-test: only_source option
Add the only_source option, analogous to only_target. Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Reviewed-by: Fabiano Rosas <farosas@suse.de> Link: https://lore.kernel.org/qemu-devel/1759332851-370353-15-git-send-email-steven.sistare@oracle.com Signed-off-by: Fabiano Rosas <farosas@suse.de>
This commit is contained in:
committed by
Fabiano Rosas
parent
5419f36e9e
commit
0a3aeedb39
@@ -234,7 +234,7 @@ static void migrate_start_set_capabilities(QTestState *from, QTestState *to,
|
||||
* to mimic as closer as that.
|
||||
*/
|
||||
migrate_set_capability(from, "events", true);
|
||||
if (!args->defer_target_connect) {
|
||||
if (!args->defer_target_connect && to) {
|
||||
migrate_set_capability(to, "events", true);
|
||||
}
|
||||
|
||||
@@ -246,8 +246,10 @@ static void migrate_start_set_capabilities(QTestState *from, QTestState *to,
|
||||
if (args->caps[MIGRATION_CAPABILITY_MULTIFD]) {
|
||||
migrate_set_parameter_int(from, "multifd-channels",
|
||||
MULTIFD_TEST_CHANNELS);
|
||||
migrate_set_parameter_int(to, "multifd-channels",
|
||||
MULTIFD_TEST_CHANNELS);
|
||||
if (to) {
|
||||
migrate_set_parameter_int(to, "multifd-channels",
|
||||
MULTIFD_TEST_CHANNELS);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -410,11 +412,13 @@ int migrate_start(QTestState **from, QTestState **to, const char *uri,
|
||||
shmem_opts ? shmem_opts : "",
|
||||
args->opts_target ? args->opts_target : "",
|
||||
ignore_stderr);
|
||||
*to = qtest_init_ext(QEMU_ENV_DST, cmd_target, capabilities,
|
||||
!args->defer_target_connect);
|
||||
qtest_qmp_set_event_callback(*to,
|
||||
migrate_watch_for_events,
|
||||
&dst_state);
|
||||
if (!args->only_source) {
|
||||
*to = qtest_init_ext(QEMU_ENV_DST, cmd_target, capabilities,
|
||||
!args->defer_target_connect);
|
||||
qtest_qmp_set_event_callback(*to,
|
||||
migrate_watch_for_events,
|
||||
&dst_state);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove shmem file immediately to avoid memory leak in test failed case.
|
||||
@@ -424,7 +428,9 @@ int migrate_start(QTestState **from, QTestState **to, const char *uri,
|
||||
unlink(shmem_path);
|
||||
}
|
||||
|
||||
migrate_start_set_capabilities(*from, *to, args);
|
||||
migrate_start_set_capabilities(*from,
|
||||
args->only_source ? NULL : *to,
|
||||
args);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -103,6 +103,8 @@ typedef struct {
|
||||
*/
|
||||
bool hide_stderr;
|
||||
bool use_shmem;
|
||||
/* only launch the source process */
|
||||
bool only_source;
|
||||
/* only launch the target process */
|
||||
bool only_target;
|
||||
/* Use dirty ring if true; dirty logging otherwise */
|
||||
|
||||
Reference in New Issue
Block a user