[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v1 03/26] tests/qtest: migration: Add migrate_incoming_qmp he
From: |
Fabiano Rosas |
Subject: |
[RFC PATCH v1 03/26] tests/qtest: migration: Add migrate_incoming_qmp helper |
Date: |
Thu, 30 Mar 2023 15:03:13 -0300 |
From: Nikolay Borisov <nborisov@suse.com>
file-based migration requires the target to initiate its migration after
the source has finished writing out the data in the file. Currently
there's no easy way to initiate 'migrate-incoming', allow this by
introducing migrate_incoming_qmp helper, similarly to migrate_qmp.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
tests/qtest/migration-helpers.c | 19 +++++++++++++++++++
tests/qtest/migration-helpers.h | 4 ++++
2 files changed, 23 insertions(+)
diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c
index f6f3c6680f..8161495c27 100644
--- a/tests/qtest/migration-helpers.c
+++ b/tests/qtest/migration-helpers.c
@@ -130,6 +130,25 @@ void migrate_qmp(QTestState *who, const char *uri, const
char *fmt, ...)
qobject_unref(rsp);
}
+
+void migrate_incoming_qmp(QTestState *who, const char *uri, const char *fmt,
...)
+{
+ va_list ap;
+ QDict *args, *rsp;
+
+ va_start(ap, fmt);
+ args = qdict_from_vjsonf_nofail(fmt, ap);
+ va_end(ap);
+
+ g_assert(!qdict_haskey(args, "uri"));
+ qdict_put_str(args, "uri", uri);
+
+ rsp = qtest_qmp(who, "{ 'execute': 'migrate-incoming', 'arguments': %p}",
args);
+
+ g_assert(qdict_haskey(rsp, "return"));
+ qobject_unref(rsp);
+}
+
/*
* Note: caller is responsible to free the returned object via
* qobject_unref() after use
diff --git a/tests/qtest/migration-helpers.h b/tests/qtest/migration-helpers.h
index a188b62787..53ddeaebb7 100644
--- a/tests/qtest/migration-helpers.h
+++ b/tests/qtest/migration-helpers.h
@@ -31,6 +31,10 @@ QDict *qmp_command(QTestState *who, const char *command,
...);
G_GNUC_PRINTF(3, 4)
void migrate_qmp(QTestState *who, const char *uri, const char *fmt, ...);
+G_GNUC_PRINTF(3, 4)
+void migrate_incoming_qmp(QTestState *who, const char *uri,
+ const char *fmt, ...);
+
QDict *migrate_query(QTestState *who);
QDict *migrate_query_not_failed(QTestState *who);
--
2.35.3
- [RFC PATCH v1 00/26] migration: File based migration with multifd and fixed-ram, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 02/26] migration: Add support for 'file:' uri for incoming migration, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 04/26] tests/qtest: migration-test: Add tests for file-based migration, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 01/26] migration: Add support for 'file:' uri for source migration, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 03/26] tests/qtest: migration: Add migrate_incoming_qmp helper,
Fabiano Rosas <=
- [RFC PATCH v1 05/26] migration: Initial support of fixed-ram feature for analyze-migration.py, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 06/26] io: add and implement QIO_CHANNEL_FEATURE_SEEKABLE for channel file, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 08/26] io: implement io_pwritev/preadv for QIOChannelFile, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 07/26] io: Add generic pwritev/preadv interface, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 09/26] migration/qemu-file: add utility methods for working with seekable channels, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 10/26] migration/ram: Introduce 'fixed-ram' migration stream capability, Fabiano Rosas, 2023/03/30