You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu-kvm/SOURCES/kvm-tests-migration-tests-A...

70 lines
2.5 KiB

From 16ba989e9c7606719bb1ab4d5511bac6c2c0d625 Mon Sep 17 00:00:00 2001
From: Peter Xu <peterx@redhat.com>
Date: Wed, 19 Jun 2024 18:30:43 -0400
Subject: [PATCH 08/11] tests/migration-tests: Always enable migration events
RH-Author: Juraj Marcin <None>
RH-MergeRequest: 419: migration: New postcopy state, and some cleanups [rhel-9.5.z]
RH-Jira: RHEL-63874
RH-Acked-by: Peter Xu <peterx@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Commit: [8/11] 02182a6c1e9b492ca90b86e0568657c55bac121d
Libvirt should always enable it, so it'll be nice qtest also cover that for
all tests on both sides. migrate_incoming_qmp() used to enable it only on
dst, now we enable them on both, as we'll start to sanity check events even
on the src QEMU.
We'll need to leave the one in migrate_incoming_qmp(), because
virtio-net-failover test uses that one only, and it relies on the events to
work.
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
(cherry picked from commit cd313b66f203381f2f2f984d5155d7942d26725d)
JIRA: https://issues.redhat.com/browse/RHEL-63874
Y-JIRA: https://issues.redhat.com/browse/RHEL-38485
Signed-off-by: Juraj Marcin <jmarcin@redhat.com>
---
tests/qtest/migration-helpers.c | 1 +
tests/qtest/migration-test.c | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c
index e451dbdbed..50a6bc2569 100644
--- a/tests/qtest/migration-helpers.c
+++ b/tests/qtest/migration-helpers.c
@@ -107,6 +107,7 @@ void migrate_incoming_qmp(QTestState *to, const char *uri, const char *fmt, ...)
g_assert(!qdict_haskey(args, "uri"));
qdict_put_str(args, "uri", uri);
+ /* This function relies on the event to work, make sure it's enabled */
migrate_set_capability(to, "events", true);
rsp = qtest_qmp(to, "{ 'execute': 'migrate-incoming', 'arguments': %p}",
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 0808300f5b..9f29f4e4f3 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -908,6 +908,13 @@ static int test_migrate_start(QTestState **from, QTestState **to,
unlink(shmem_path);
}
+ /*
+ * Always enable migration events. Libvirt always uses it, let's try
+ * to mimic as closer as that.
+ */
+ migrate_set_capability(*from, "events", true);
+ migrate_set_capability(*to, "events", true);
+
return 0;
}
--
2.39.3