diff options
author | Steve Sistare <steven.sistare@oracle.com> | 2024-01-03 12:05:38 -0800 |
---|---|---|
committer | Peter Xu <peterx@redhat.com> | 2024-01-04 09:52:42 +0800 |
commit | f0649758be63da16d215344011fc67aa07531542 (patch) | |
tree | d51907ec6e8c6b72e9c276022e514b8a09775339 /tests/qtest/migration-helpers.c | |
parent | 49a5020697001eb96693e8a289c13b89149c7fef (diff) |
tests/qtest: migration events
Define a state object to capture events seen by migration tests, to allow
more events to be captured in a subsequent patch, and simplify event
checking in wait_for_migration_pass. No functional change.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: "Daniel P. Berrangé" <berrange@redhat.com>
Link: https://lore.kernel.org/r/1704312341-66640-10-git-send-email-steven.sistare@oracle.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'tests/qtest/migration-helpers.c')
-rw-r--r-- | tests/qtest/migration-helpers.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c index 24fb7b3525..fd3b94efa2 100644 --- a/tests/qtest/migration-helpers.c +++ b/tests/qtest/migration-helpers.c @@ -24,26 +24,16 @@ */ #define MIGRATION_STATUS_WAIT_TIMEOUT 120 -bool migrate_watch_for_stop(QTestState *who, const char *name, - QDict *event, void *opaque) +bool migrate_watch_for_events(QTestState *who, const char *name, + QDict *event, void *opaque) { - bool *seen = opaque; + QTestMigrationState *state = opaque; if (g_str_equal(name, "STOP")) { - *seen = true; + state->stop_seen = true; return true; - } - - return false; -} - -bool migrate_watch_for_resume(QTestState *who, const char *name, - QDict *event, void *opaque) -{ - bool *seen = opaque; - - if (g_str_equal(name, "RESUME")) { - *seen = true; + } else if (g_str_equal(name, "RESUME")) { + state->resume_seen = true; return true; } |