From: Wei Wang <wei.w.wang@intel.com>
To: quintela@redhat.com, peterx@redhat.com, lei4.wang@intel.com
Cc: qemu-devel@nongnu.org, Wei Wang <wei.w.wang@intel.com>
Subject: [PATCH v2 2/2] qtest/migration-tests.c: use "-incoming defer" for postcopy tests
Date: Tue, 6 Jun 2023 18:19:10 +0800 [thread overview]
Message-ID: <20230606101910.20456-3-wei.w.wang@intel.com> (raw)
In-Reply-To: <20230606101910.20456-1-wei.w.wang@intel.com>
The Postcopy preempt capability is expected to be set before incoming
starts, so change the postcopy tests to start with deferred incoming and
call migrate-incoming after the cap has been set.
Why the existing tests (without this patch) didn't fail?
There could be two reasons:
1) "backlog" specifies the number of pending connections. As long as the
server accepts the connections faster than the clients side connecting,
connection will succeed. For the preempt test, it uses only 2 channels,
so very likely to not have pending connections.
2) per my tests (on kernel 6.2), the number of pending connections allowed
is actually "backlog + 1", which is 2 in this case.
That said, the implementation of socket_start_incoming_migration_internal
expects "migrate defer" to be used, and for safety, change the test to
work with the expected usage.
Signed-off-by: Wei Wang <wei.w.wang@intel.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
---
tests/qtest/migration-test.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index b0c355bbd9..cbdbc932de 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -1143,10 +1143,11 @@ static int migrate_postcopy_prepare(QTestState **from_ptr,
QTestState **to_ptr,
MigrateCommon *args)
{
- g_autofree char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
+ g_autofree char *uri = NULL;
QTestState *from, *to;
+ QDict *rsp;
- if (test_migrate_start(&from, &to, uri, &args->start)) {
+ if (test_migrate_start(&from, &to, "defer", &args->start)) {
return -1;
}
@@ -1165,9 +1166,14 @@ static int migrate_postcopy_prepare(QTestState **from_ptr,
migrate_ensure_non_converge(from);
+ rsp = wait_command(to, "{ 'execute': 'migrate-incoming',"
+ " 'arguments': { 'uri': 'tcp:127.0.0.1:0' }}");
+ qobject_unref(rsp);
+
/* Wait for the first serial output from the source */
wait_for_serial("src_serial");
+ uri = migrate_get_socket_address(to, "socket-address");
migrate_qmp(from, uri, "{}");
wait_for_migration_pass(from);
--
2.27.0
next prev parent reply other threads:[~2023-06-06 10:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 10:19 [PATCH RESEND v2 0/2] Enfore multifd and postcopy preempt setting Wei Wang
2023-06-06 10:19 ` [PATCH v2 1/2] migration: enfocre multifd and postcopy preempt to be set before incoming Wei Wang
2023-06-21 19:41 ` Juan Quintela
2023-06-21 20:34 ` Juan Quintela
2023-06-06 10:19 ` Wei Wang [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-05-30 9:02 [PATCH v2 0/2] Enfore multifd and postcopy preempt setting Wei Wang
2023-05-30 9:02 ` [PATCH v2 2/2] qtest/migration-tests.c: use "-incoming defer" for postcopy tests Wei Wang
2023-05-30 14:41 ` Peter Xu
2023-05-31 10:41 ` Wang, Wei W
2023-05-31 12:58 ` Peter Xu
2023-06-01 9:12 ` Wang, Wei W
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230606101910.20456-3-wei.w.wang@intel.com \
--to=wei.w.wang@intel.com \
--cc=lei4.wang@intel.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).