mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
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>
This commit is contained in:
parent
49a5020697
commit
f0649758be
3 changed files with 56 additions and 68 deletions
|
@ -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 *seen = opaque;
|
||||
|
||||
if (g_str_equal(name, "STOP")) {
|
||||
*seen = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool migrate_watch_for_resume(QTestState *who, const char *name,
|
||||
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, "RESUME")) {
|
||||
*seen = true;
|
||||
if (g_str_equal(name, "STOP")) {
|
||||
state->stop_seen = true;
|
||||
return true;
|
||||
} else if (g_str_equal(name, "RESUME")) {
|
||||
state->resume_seen = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue