From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: qemu-devel@nongnu.org, Juan Quintela <quintela@redhat.com>,
Peter Xu <peterx@redhat.com>,
Steve Sistare <steven.sistare@oracle.com>,
Leonardo Bras <leobras@redhat.com>,
Thomas Huth <thuth@redhat.com>,
Laurent Vivier <lvivier@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v4 6/6] tests/qtest: migration-test: Add tests for file-based migration
Date: Wed, 12 Jul 2023 08:03:33 +0100 [thread overview]
Message-ID: <ZK5QRcSYw/88j5uj@redhat.com> (raw)
In-Reply-To: <87jzv6jd7l.fsf@suse.de>
On Tue, Jul 11, 2023 at 07:27:42PM -0300, Fabiano Rosas wrote:
> Fabiano Rosas <farosas@suse.de> writes:
>
> > Add basic tests for file-based migration.
> >
> > Signed-off-by: Fabiano Rosas <farosas@suse.de>
> > Reviewed-by: Peter Xu <peterx@redhat.com>
> > ---
> > tests/qtest/migration-test.c | 99 ++++++++++++++++++++++++++++++++++++
> > 1 file changed, 99 insertions(+)
> >
> > diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
> > index 2fdf6a115e..c052dbe1f1 100644
> > --- a/tests/qtest/migration-test.c
> > +++ b/tests/qtest/migration-test.c
> > @@ -52,6 +52,10 @@ static bool got_dst_resume;
> > */
> > #define DIRTYLIMIT_TOLERANCE_RANGE 25 /* MB/s */
> >
> > +#define QEMU_VM_FILE_MAGIC 0x5145564d
> > +#define FILE_TEST_FILENAME "migfile"
> > +#define FILE_TEST_OFFSET 0x1000
> > +
> > #if defined(__linux__)
> > #include <sys/syscall.h>
> > #include <sys/vfs.h>
> > @@ -762,6 +766,7 @@ static void test_migrate_end(QTestState *from, QTestState *to, bool test_dest)
> > cleanup("migsocket");
> > cleanup("src_serial");
> > cleanup("dest_serial");
> > + cleanup(FILE_TEST_FILENAME);
> > }
> >
> > #ifdef CONFIG_GNUTLS
> > @@ -1459,11 +1464,28 @@ static void test_precopy_common(MigrateCommon *args)
> > */
> > wait_for_migration_complete(from);
> >
> > + /*
> > + * For file based migration the target must begin its
> > + * migration after the source has finished.
> > + */
> > + if (strstr(connect_uri, "file:")) {
> > + migrate_incoming_qmp(to, connect_uri, "{}");
> > + }
> > +
>
> This is now broken since we merged commit e02f56e3de ("tests/qtest:
> massively speed up migration-test").
>
> We cannot monitor the destination while the source is still running
> because we need the source to have finished writing to the file before
> we can start the destination. I'll have to think of another way of
> testing a migration that is done with a live source but asynchronous
> incoming migration.
>
> Any suggestions are welcome.
Don't use test_precopy_common() at all. This helper is written from the
POV that we're actually doing a live migration. Migrate to/from file is
not live migration.
So open code the subset of pieces of test_precopy_common() that you
need for file migration. There are a handful of other tests that
take this approach since test_precopy_common wasn't suitable for
them eg test_migrate_auto_converge()
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
prev parent reply other threads:[~2023-07-12 7:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-06 20:19 [PATCH v4 0/6] migration: Test the new "file:" migration Fabiano Rosas
2023-07-06 20:19 ` [PATCH v4 1/6] tests/qtest: migration: Expose migrate_set_capability Fabiano Rosas
2023-07-06 20:19 ` [PATCH v4 2/6] tests/qtest: migration: Add migrate_incoming_qmp helper Fabiano Rosas
2023-07-06 20:19 ` [PATCH v4 3/6] tests/qtest: migration: Use migrate_incoming_qmp where appropriate Fabiano Rosas
2023-07-06 20:19 ` [PATCH v4 4/6] migration: Set migration status early in incoming side Fabiano Rosas
2023-07-06 20:19 ` [PATCH v4 5/6] tests/qtest: migration: Add support for negative testing of qmp_migrate Fabiano Rosas
2023-07-06 20:19 ` [PATCH v4 6/6] tests/qtest: migration-test: Add tests for file-based migration Fabiano Rosas
2023-07-11 22:27 ` Fabiano Rosas
2023-07-12 7:03 ` Daniel P. Berrangé [this message]
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=ZK5QRcSYw/88j5uj@redhat.com \
--to=berrange@redhat.com \
--cc=farosas@suse.de \
--cc=leobras@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).