summary refs log tree commit diff stats
path: root/tests/qtest/migration-helpers.c
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2023-06-01 17:13:44 +0100
committerJuan Quintela <quintela@redhat.com>2023-06-02 11:46:19 +0200
commit266ea334b2ea96890e268acff1a26b4a71804361 (patch)
tree59e40973158ff15ad9f730b63a6fdd8ea816af7b /tests/qtest/migration-helpers.c
parentaca040695890fe67b44402fdb167809809946068 (diff)
downloadfocaccia-qemu-266ea334b2ea96890e268acff1a26b4a71804361.tar.gz
focaccia-qemu-266ea334b2ea96890e268acff1a26b4a71804361.zip
tests/qtest: capture RESUME events during migration
When running migration tests we monitor for a STOP event so we can skip
redundant waits. This will be needed for the RESUME event too shortly.

Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230601161347.1803440-8-berrange@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'tests/qtest/migration-helpers.c')
-rw-r--r--tests/qtest/migration-helpers.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c
index 73e506a5f8..be00c52d00 100644
--- a/tests/qtest/migration-helpers.c
+++ b/tests/qtest/migration-helpers.c
@@ -36,6 +36,19 @@ bool migrate_watch_for_stop(QTestState *who, const char *name,
     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;
+        return true;
+    }
+
+    return false;
+}
+
 /*
  * Send QMP command "migrate".
  * Arguments are built from @fmt... (formatted like