From: Fabiano Rosas <farosas@suse.de>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, "Juan Quintela" <quintela@redhat.com>,
"Steve Sistare" <steven.sistare@oracle.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH 3/6] tests/qtest: migration: Add migrate_incoming_qmp helper
Date: Fri, 30 Jun 2023 11:57:49 -0300 [thread overview]
Message-ID: <877crlq9oy.fsf@suse.de> (raw)
In-Reply-To: <ZJ30tJ+3umGH2Xto@x1n>
Peter Xu <peterx@redhat.com> writes:
> On Wed, Jun 28, 2023 at 01:55:39PM -0300, Fabiano Rosas wrote:
>> 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.
>>
>> Also make sure migration events are enabled and wait for the incoming
>> migration to start before returning. This avoid a race when querying
>> the migration status too soon after issuing the command.
>>
>> Signed-off-by: Fabiano Rosas <farosas@suse.de>
>> ---
>> tests/qtest/migration-helpers.c | 28 ++++++++++++++++++++++++++++
>> tests/qtest/migration-helpers.h | 4 ++++
>> 2 files changed, 32 insertions(+)
>>
>> diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c
>> index 2df198c99e..bc54b29184 100644
>> --- a/tests/qtest/migration-helpers.c
>> +++ b/tests/qtest/migration-helpers.c
>> @@ -81,6 +81,34 @@ void migrate_set_capability(QTestState *who, const char *capability,
>> capability, value);
>> }
>>
>> +void migrate_incoming_qmp(QTestState *to, const char *uri, const char *fmt, ...)
>> +{
>> + va_list ap;
>> + QDict *args, *rsp, *data;
>> +
>> + 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);
>> +
>> + migrate_set_capability(to, "events", true);
>> +
>> + rsp = qtest_qmp(to, "{ 'execute': 'migrate-incoming', 'arguments': %p}",
>> + args);
>> + g_assert(qdict_haskey(rsp, "return"));
>
> rsp leaked?
>
Good catch. I'll fix it.
next prev parent reply other threads:[~2023-06-30 14:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-28 16:55 [PATCH 0/6] migration: Test the new "file:" migration Fabiano Rosas
2023-06-28 16:55 ` [PATCH 1/6] migration: Set migration status early in incoming side Fabiano Rosas
2023-06-29 19:18 ` Peter Xu
2023-06-30 14:57 ` Fabiano Rosas
2023-06-28 16:55 ` [PATCH 2/6] tests/qtest: migration: Expose migrate_set_capability Fabiano Rosas
2023-06-29 6:46 ` Thomas Huth
2023-06-28 16:55 ` [PATCH 3/6] tests/qtest: migration: Add migrate_incoming_qmp helper Fabiano Rosas
2023-06-29 21:16 ` Peter Xu
2023-06-30 14:57 ` Fabiano Rosas [this message]
2023-06-28 16:55 ` [PATCH 4/6] tests/qtest: migration: Use migrate_incoming_qmp where appropriate Fabiano Rosas
2023-06-28 16:55 ` [PATCH 5/6] tests/qtest: migration: Add support for negative testing of qmp_migrate Fabiano Rosas
2023-06-28 16:55 ` [PATCH 6/6] tests/qtest: migration-test: Add tests for file-based migration Fabiano Rosas
2023-06-29 21:36 ` Peter Xu
2023-06-30 15:05 ` Fabiano Rosas
2023-06-30 15:19 ` Steven Sistare
2023-06-30 16:25 ` Peter Xu
-- strict thread matches above, loose matches on Subject: below --
2023-06-26 18:22 [PATCH 0/6] migration: Test the new "file:" migration Fabiano Rosas
2023-06-26 18:22 ` [PATCH 3/6] tests/qtest: migration: Add migrate_incoming_qmp helper Fabiano Rosas
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=877crlq9oy.fsf@suse.de \
--to=farosas@suse.de \
--cc=berrange@redhat.com \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=steven.sistare@oracle.com \
--cc=thuth@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).