[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 7/9] tests/qtest: capture RESUME events during migration
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH v3 7/9] tests/qtest: capture RESUME events during migration |
Date: |
Thu, 1 Jun 2023 13:44:09 +0100 |
User-agent: |
Mutt/2.2.9 (2022-11-12) |
On Thu, Jun 01, 2023 at 02:37:37PM +0200, Juan Quintela wrote:
> Daniel P. Berrangé <berrange@redhat.com> wrote:
> > On Thu, Jun 01, 2023 at 02:31:13PM +0200, Juan Quintela wrote:
> >> Daniel P. Berrangé <berrange@redhat.com> wrote:
> >> > When running migration tests we monitor for a STOP event so we can skip
> >> > redundant waits. This will be needed for the RESUME event too shortly.
> >> >
> >> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> >> > ---
> >> > tests/qtest/migration-helpers.c | 12 ++++++++++++
> >> > tests/qtest/migration-helpers.h | 2 ++
> >> > tests/qtest/migration-test.c | 5 +++++
> >> > 3 files changed, 19 insertions(+)
> >> >
> >> > diff --git a/tests/qtest/migration-helpers.c
> >> > b/tests/qtest/migration-helpers.c
> >> > index 884d8a2e07..d50b565967 100644
> >> > --- a/tests/qtest/migration-helpers.c
> >> > +++ b/tests/qtest/migration-helpers.c
> >> > @@ -35,6 +35,18 @@ bool migrate_watch_for_stop(QTestState *who, const
> >> > char *name,
> >> > return false;
> >> > }
> >> >
> >> > +bool migrate_watch_for_resume(QTestState *who, const char *name,
> >> > + QDict *event, void *opaque)
> >> > +{
> >> > + bool *seen = opaque;
> >> > +
> >> > + if (g_str_equal(name, "RESUME")) {
> >> > + *seen = true;
> >> > + }
> >> > +
> >> > + return false;
> >> > +}
> >> > +
> >>
> >> I think I am not understanding this.
> >>
> >> Can we wait for both RESUME and STOP events?
> >>
> >> Or do you want an implementation that can only look for one event?
> >
> > For the purpose of the migration test we only need the STOP event
> > on the src and the RESUME event on the dst. While I could have made
> > it track both STOP and RESUME events on both src & dst, I figured
> > it was overkill.
>
> Fair enough.
I think I'll rename 'bool got_stop' to 'bool got_src_stop' and have
'bool got_dst_resume' to make it explicit which QEMU they're referring
to.
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 :|