[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 32/42] migration-test: Create guest_set_uri()
From: |
Juan Quintela |
Subject: |
[PATCH 32/42] migration-test: Create guest_set_uri() |
Date: |
Fri, 9 Jun 2023 00:49:33 +0200 |
We need this for migration-incoming cases.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
tests/qtest/migration-test.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 0afe871cfb..f029258f67 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -286,6 +286,12 @@ static void guest_listen_unix_socket(GuestState *vm)
vm->uri = g_strdup_printf("unix:%s", vm->unix_socket);
}
+static void guest_set_uri(GuestState *vm, const gchar *uri)
+{
+ g_free(vm->uri);
+ vm->uri = g_strdup(uri);
+}
+
/*
* Wait for some output in the serial output file,
* we get an 'A' followed by an endless string of 'B's
@@ -1918,6 +1924,7 @@ static void *test_migrate_fd_start_hook(GuestState *from,
GuestState *to)
/* Start incoming migration from the 1st socket */
qtest_qmp_assert_success(to->qs, "{ 'execute': 'migrate-incoming',"
" 'arguments': { 'uri': 'fd:fd-mig' }}");
+ guest_set_uri(to, "fd:fd-mig");
/* Send the 2nd socket to the target */
qtest_qmp_fds_assert_success(from->qs, &pair[1], 1,
@@ -1958,7 +1965,6 @@ static void test_migrate_fd_proto(void)
GuestState *to = guest_create("target");
MigrateCommon args = {
.listen_uri = "defer",
- .connect_uri = "fd:fd-mig",
.start_hook = test_migrate_fd_start_hook,
.finish_hook = test_migrate_fd_finish_hook
};
@@ -2145,6 +2151,7 @@ test_migrate_precopy_tcp_multifd_start_common(GuestState
*from, GuestState *to,
/* Start incoming migration from the 1st socket */
qtest_qmp_assert_success(to->qs, "{ 'execute': 'migrate-incoming',"
" 'arguments': { 'uri': 'tcp:127.0.0.1:0' }}");
+ guest_set_uri(to, "tcp:127.0.0.1:0");
return NULL;
}
@@ -2411,6 +2418,7 @@ static void test_multifd_tcp_cancel(void)
/* Start incoming migration from the 1st socket */
qtest_qmp_assert_success(to->qs, "{ 'execute': 'migrate-incoming',"
" 'arguments': { 'uri': 'tcp:127.0.0.1:0' }}");
+ guest_set_uri(to, "tcp:127.0.0.1:0");
/* Wait for the first serial output from the source */
wait_for_serial(from);
@@ -2440,6 +2448,7 @@ static void test_multifd_tcp_cancel(void)
/* Start incoming migration from the 1st socket */
qtest_qmp_assert_success(to2->qs, "{ 'execute': 'migrate-incoming',"
" 'arguments': { 'uri': 'tcp:127.0.0.1:0' }}");
+ guest_set_uri(to2, "tcp:127.0.0.1:0");
wait_for_migration_status(from->qs, "cancelled", NULL);
--
2.40.1
- [PATCH 24/42] migration-test: Re-enable multifd_cancel test, (continued)
- [PATCH 26/42] migration-test: create guest_use_shmem(), Juan Quintela, 2023/06/08
- [PATCH 29/42] migration-test: Create the migration unix socket by guest, Juan Quintela, 2023/06/08
- [PATCH 25/42] migration-test: We were not waiting for "target" to finish, Juan Quintela, 2023/06/08
- [PATCH 27/42] migration-test: Create guest_extra_opts(), Juan Quintela, 2023/06/08
- [PATCH 28/42] migration-test: Create guest_hide_stderr(), Juan Quintela, 2023/06/08
- [PATCH 30/42] migration-test: Hooks also need GuestState, Juan Quintela, 2023/06/08
- [PATCH 32/42] migration-test: Create guest_set_uri(),
Juan Quintela <=
- [PATCH 33/42] migration-test: Remove connect_uri, Juan Quintela, 2023/06/08
- [PATCH 31/42] migration-test: Preffer to->uri to uri parameter for migration, Juan Quintela, 2023/06/08
- [PATCH 36/42] migration-test: Remove unused listen_uri, Juan Quintela, 2023/06/08
- [PATCH 34/42] migration-test: Use new schema for all tests that use unix sockets, Juan Quintela, 2023/06/08
- [PATCH 35/42] migration-test: Set uri for tcp tests with guest_set_uri(), Juan Quintela, 2023/06/08
- [PATCH 37/42] migration-test: Create get_event GuestState variable, Juan Quintela, 2023/06/08
- [PATCH 38/42] migration-test: Create guest_realize(), Juan Quintela, 2023/06/08
- [PATCH 39/42] migration-test: Unfold test_migrate_end() into three functions, Juan Quintela, 2023/06/08
- [PATCH 40/42] migration-test: Create migrate_incoming() function, Juan Quintela, 2023/06/08
- [PATCH 41/42] migration-test: Move functions to migration-helpers.c, Juan Quintela, 2023/06/08