All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, Mark Kanda <mark.kanda@oracle.com>,
	Ben Chaney <bchaney@akamai.com>,
	Laurent Vivier <lvivier@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v1 11/15] tests/qtest/migration: Use defer for cpr-tests
Date: Fri, 22 May 2026 10:23:48 -0300	[thread overview]
Message-ID: <87pl2n60ij.fsf@suse.de> (raw)
In-Reply-To: <ag3xQBVVv74srgKo@x1.local>

Peter Xu <peterx@redhat.com> writes:

> On Tue, May 05, 2026 at 01:09:10PM -0300, Fabiano Rosas wrote:
>> Signed-off-by: Fabiano Rosas <farosas@suse.de>
>> ---
>>  tests/qtest/migration/cpr-tests.c | 21 ++++++++++++---------
>
> Reviewed-by: Peter Xu <peterx@redhat.com>
>
> Only one thing to double check:
>
>>  1 file changed, 12 insertions(+), 9 deletions(-)
>> 
>> diff --git a/tests/qtest/migration/cpr-tests.c b/tests/qtest/migration/cpr-tests.c
>> index 18217f0460..9091a84213 100644
>> --- a/tests/qtest/migration/cpr-tests.c
>> +++ b/tests/qtest/migration/cpr-tests.c
>> @@ -60,7 +60,7 @@ static int test_transfer(MigrateCommon *args, const char *cpr_channel,
>>      obj = migrate_str_to_channel(cpr_channel);
>>      qlist_append(channels_list, obj);
>>  
>> -    if (migrate_start(&from, &to, args->listen_uri, &args->start)) {
>> +    if (migrate_start(&from, &to, "defer", &args->start)) {
>>          return -1;
>>      }
>>  
>> @@ -128,11 +128,17 @@ static void test_mode_transfer_common(MigrateCommon *args, bool incoming_defer)
>>      int cpr_sockfd = qtest_socket_server(cpr_path);
>>      g_assert(cpr_sockfd >= 0);
>>  
>> -    opts_target = g_strdup_printf("-incoming cpr,addr.transport=socket,"
>> -                                  "addr.type=fd,addr.str=%d %s",
>> -                                  cpr_sockfd, opts);
>> +    if (incoming_defer) {
>> +        opts_target = g_strdup_printf("-incoming cpr,addr.transport=socket,"
>> +                                      "addr.type=fd,addr.str=%d %s",
>> +                                      cpr_sockfd, opts);
>> +    } else {
>> +        opts_target = g_strdup_printf("-incoming %s "
>> +                                      "-incoming cpr,addr.transport=socket,"
>> +                                      "addr.type=fd,addr.str=%d %s",
>> +                                      uri, cpr_sockfd, opts);
>
> IIUC now in this path qtest will ultimately generate cmdline like this for
> dest:
>
>   -incoming defer \
>   -incoming unix:... \
>   -incoming cpr,addr...
>
> I am not sure if this is the intention, but it looks working indeed where
> the 1st defer will be an no-op, and "-incoming" allows overwrites.
>

Yes, it's on purpose, I think I remember some discussion at the time
about this and we decided it was ok.

In any case, it's probably good to have some variability because that
parsing code at vl.c is quite fragile in my opinion. Better to find a
breakage during testing than in production.

> We'll just need to remember this and be careful in the future on the order
> of these parameters. Say, if we accidentally move the first "-incoming
> defer" parameter to be after opts_target, then it might break, because then
> it's not no-op anymore but freeing the main channel we just set.
>
> But I think it's ok for now.
>
>> +    }
>>  
>> -    args->listen_uri = incoming_defer ? "defer" : uri;
>>      args->connect_channels = connect_channels;
>>  
>>      args->start.opts_source = opts;
>> @@ -224,7 +230,7 @@ static void test_cpr_exec(MigrateCommon *args)
>>      g_autofree char *filename = g_strdup_printf("%s/%s", tmpfs,
>>                                                  FILE_TEST_FILENAME);
>>  
>> -    if (migrate_start(&from, NULL, args->listen_uri, &args->start)) {
>> +    if (migrate_start(&from, NULL, "defer", &args->start)) {
>>          return;
>>      }
>>  
>> @@ -274,10 +280,7 @@ static void test_mode_exec(char *name, MigrateCommon *args)
>>  {
>>      g_autofree char *uri = g_strdup_printf("file:%s/%s", tmpfs,
>>                                             FILE_TEST_FILENAME);
>> -    g_autofree char *listen_uri = g_strdup_printf("defer");
>> -
>>      args->connect_uri = uri;
>> -    args->listen_uri = listen_uri;
>>      args->start_hook = test_mode_exec_start;
>>  
>>      args->start.only_source = true;
>> -- 
>> 2.51.0
>> 


  reply	other threads:[~2026-05-22 13:24 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05 16:08 [PATCH v1 00/15] tests/qtest/migration: Always defer Fabiano Rosas
2026-05-05 16:09 ` [PATCH v1 01/15] tests/qtest/migration: Move cpr transfer logic into cpr-tests.c Fabiano Rosas
2026-05-19 20:43   ` Peter Xu
2026-05-05 16:09 ` [PATCH v1 02/15] tests/qtest/migration: Make file-tests defer by default Fabiano Rosas
2026-05-19 20:45   ` Peter Xu
2026-05-05 16:09 ` [PATCH v1 03/15] tests/qtest/migration: Set file URI " Fabiano Rosas
2026-05-19 20:46   ` Peter Xu
2026-05-05 16:09 ` [PATCH v1 04/15] tests/qtest/migration: Group unix migration tests Fabiano Rosas
2026-05-19 20:47   ` Peter Xu
2026-05-05 16:09 ` [PATCH v1 05/15] tests/qtest/migration: Use precopy_unix_common for ignore-shared test Fabiano Rosas
2026-05-20 16:06   ` Peter Xu
2026-05-05 16:09 ` [PATCH v1 06/15] tests/qtest/migration: Use a default TCP URI for precopy Fabiano Rosas
2026-05-20 16:07   ` Peter Xu
2026-05-05 16:09 ` [PATCH v1 07/15] tests/qtest/migration: Defer by default in precopy_common Fabiano Rosas
2026-05-12 14:27   ` Lukas Straub
2026-05-20 16:14   ` Peter Xu
2026-05-05 16:09 ` [PATCH v1 08/15] tests/qtest/migration: Set compression method in compression-tests Fabiano Rosas
2026-05-20 16:15   ` Peter Xu
2026-05-05 16:09 ` [PATCH v1 09/15] tests/qtest/migration: Remove multifd compression hook Fabiano Rosas
2026-05-20 16:16   ` Peter Xu
2026-05-05 16:09 ` [PATCH v1 10/15] tests/qtest/migration: Use defer for all tests Fabiano Rosas
2026-05-20 16:20   ` Peter Xu
2026-05-05 16:09 ` [PATCH v1 11/15] tests/qtest/migration: Use defer for cpr-tests Fabiano Rosas
2026-05-20 17:37   ` Peter Xu
2026-05-22 13:23     ` Fabiano Rosas [this message]
2026-05-05 16:09 ` [PATCH v1 12/15] tests/qtest/migration: Use defer for auto-converge Fabiano Rosas
2026-05-20 17:37   ` Peter Xu
2026-05-05 16:09 ` [PATCH v1 13/15] tests/qtest/migration: Use defer in dirty_limit test Fabiano Rosas
2026-05-20 17:37   ` Peter Xu
2026-05-05 16:09 ` [PATCH v1 14/15] tests/qtest/migration: Stop passing URI into migrate_start Fabiano Rosas
2026-05-12 14:27   ` Lukas Straub
2026-05-20 18:21   ` Peter Xu
2026-05-05 16:09 ` [PATCH v1 15/15] tests/qtest/migration: Unify URIs Fabiano Rosas
2026-05-12 14:26   ` Lukas Straub
2026-05-20 18:36   ` Peter Xu
2026-05-05 16:25 ` [PATCH v1 00/15] tests/qtest/migration: Always defer Peter Xu
2026-05-05 19:06   ` Fabiano Rosas
2026-05-19 20:34     ` Peter Xu
2026-05-20 18:56 ` Peter Xu

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=87pl2n60ij.fsf@suse.de \
    --to=farosas@suse.de \
    --cc=bchaney@akamai.com \
    --cc=lvivier@redhat.com \
    --cc=mark.kanda@oracle.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.