tests/migration-tests: Always enable migration events
authorPeter Xu <peterx@redhat.com>
Wed, 19 Jun 2024 22:30:43 +0000 (18:30 -0400)
committerFabiano Rosas <farosas@suse.de>
Fri, 21 Jun 2024 12:48:00 +0000 (09:48 -0300)
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>
tests/qtest/migration-helpers.c
tests/qtest/migration-test.c

index 0ac49ceb54d619993c0d71499c9b672520f3ff12..2ca4425d71a99c1592cf0509dda386fbaa2d01cb 100644 (file)
@@ -258,6 +258,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}",
index b7dea1aabbd79e7809e879c406fa52f77360d3e0..32e31fff86bd8f53b02a474918e077f5f210dd07 100644 (file)
@@ -852,6 +852,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;
 }