From: Fabiano Rosas <farosas@suse.de>
Pass the "args" parameter to the cancel tests so they can access the
config object which will be part of this struct.
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20251215220041.12657-27-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
---
tests/qtest/migration/precopy-tests.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/tests/qtest/migration/precopy-tests.c b/tests/qtest/migration/precopy-tests.c
index 086d06a31c..aca7ed51ef 100644
--- a/tests/qtest/migration/precopy-tests.c
+++ b/tests/qtest/migration/precopy-tests.c
@@ -642,7 +642,8 @@ static void test_multifd_postcopy_tcp_cancel(char *name, MigrateCommon *args)
}
static void test_cancel_src_after_failed(QTestState *from, QTestState *to,
- const char *uri, const char *phase)
+ const char *uri, const char *phase,
+ MigrateStart *args)
{
/*
* No migrate_incoming_qmp() at the start to force source into
@@ -669,7 +670,8 @@ static void test_cancel_src_after_failed(QTestState *from, QTestState *to,
}
static void test_cancel_src_after_cancelled(QTestState *from, QTestState *to,
- const char *uri, const char *phase)
+ const char *uri, const char *phase,
+ MigrateStart *args)
{
migrate_incoming_qmp(to, uri, NULL, "{ 'exit-on-error': false }");
@@ -693,7 +695,8 @@ static void test_cancel_src_after_cancelled(QTestState *from, QTestState *to,
}
static void test_cancel_src_after_complete(QTestState *from, QTestState *to,
- const char *uri, const char *phase)
+ const char *uri, const char *phase,
+ MigrateStart *args)
{
migrate_incoming_qmp(to, uri, NULL, "{ 'exit-on-error': false }");
@@ -714,7 +717,8 @@ static void test_cancel_src_after_complete(QTestState *from, QTestState *to,
}
static void test_cancel_src_after_none(QTestState *from, QTestState *to,
- const char *uri, const char *phase)
+ const char *uri, const char *phase,
+ MigrateStart *args)
{
/*
* Test that cancelling without a migration happening does not
@@ -735,7 +739,8 @@ static void test_cancel_src_after_none(QTestState *from, QTestState *to,
}
static void test_cancel_src_pre_switchover(QTestState *from, QTestState *to,
- const char *uri, const char *phase)
+ const char *uri, const char *phase,
+ MigrateStart *args)
{
migrate_set_capability(from, "pause-before-switchover", true);
migrate_set_capability(to, "pause-before-switchover", true);
@@ -775,20 +780,20 @@ static void test_cancel_src_after_status(char *test_path, MigrateCommon *args)
if (g_str_equal(phase, "cancelling") ||
g_str_equal(phase, "cancelled")) {
- test_cancel_src_after_cancelled(from, to, uri, phase);
+ test_cancel_src_after_cancelled(from, to, uri, phase, &args->start);
} else if (g_str_equal(phase, "completed")) {
- test_cancel_src_after_complete(from, to, uri, phase);
+ test_cancel_src_after_complete(from, to, uri, phase, &args->start);
} else if (g_str_equal(phase, "failed")) {
- test_cancel_src_after_failed(from, to, uri, phase);
+ test_cancel_src_after_failed(from, to, uri, phase, &args->start);
} else if (g_str_equal(phase, "none")) {
- test_cancel_src_after_none(from, to, uri, phase);
+ test_cancel_src_after_none(from, to, uri, phase, &args->start);
} else {
/* any state that comes before pre-switchover */
- test_cancel_src_pre_switchover(from, to, uri, phase);
+ test_cancel_src_pre_switchover(from, to, uri, phase, &args->start);
}
migrate_end(from, to, false);
--
2.50.1