summary refs log tree commit diff stats
path: root/tests/qtest/migration-helpers.c
diff options
context:
space:
mode:
authorFabiano Rosas <farosas@suse.de>2023-07-12 16:07:37 -0300
committerJuan Quintela <quintela@redhat.com>2023-10-11 11:17:02 +0200
commit9d47929034eb8f3e67411926bdd1e8246d2797ed (patch)
tree42a65357bcb218e857d46b4b319a7028d2b7341d /tests/qtest/migration-helpers.c
parent86dec715a7339fc61c3bdb9715993b277b2089db (diff)
downloadfocaccia-qemu-9d47929034eb8f3e67411926bdd1e8246d2797ed.tar.gz
focaccia-qemu-9d47929034eb8f3e67411926bdd1e8246d2797ed.zip
tests/qtest: migration: Expose migrate_set_capability
The following patch will make use of this function from within
migrate-helpers.c, so move it there.

Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230712190742.22294-2-farosas@suse.de>
Diffstat (limited to 'tests/qtest/migration-helpers.c')
-rw-r--r--tests/qtest/migration-helpers.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c
index be00c52d00..2df198c99e 100644
--- a/tests/qtest/migration-helpers.c
+++ b/tests/qtest/migration-helpers.c
@@ -70,6 +70,17 @@ void migrate_qmp(QTestState *who, const char *uri, const char *fmt, ...)
                              "{ 'execute': 'migrate', 'arguments': %p}", args);
 }
 
+void migrate_set_capability(QTestState *who, const char *capability,
+                            bool value)
+{
+    qtest_qmp_assert_success(who,
+                             "{ 'execute': 'migrate-set-capabilities',"
+                             "'arguments': { "
+                             "'capabilities': [ { "
+                             "'capability': %s, 'state': %i } ] } }",
+                             capability, value);
+}
+
 /*
  * Note: caller is responsible to free the returned object via
  * qobject_unref() after use