From: Kevin Wolf <kwolf@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [PATCH v2] iotests.py: Let wait_migration wait even more
Date: Fri, 20 Dec 2019 10:32:58 +0100 [thread overview]
Message-ID: <20191220093258.GB4019@dhcp-200-226.str.redhat.com> (raw)
In-Reply-To: <20191219183617.213637-1-mreitz@redhat.com>
Am 19.12.2019 um 19:36 hat Max Reitz geschrieben:
> The "migration completed" event may be sent (on the source, to be
> specific) before the migration is actually completed, so the VM runstate
> will still be "finish-migrate" instead of "postmigrate". So ask the
> users of VM.wait_migration() to specify the final runstate they desire
> and then poll the VM until it has reached that state. (This should be
> over very quickly, so busy polling is fine.)
>
> Without this patch, I see intermittent failures in the new iotest 280
> under high system load. I have not yet seen such failures with other
> iotests that use VM.wait_migration() and query-status afterwards, but
> maybe they just occur even more rarely, or it is because they also wait
> on the destination VM to be running.
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
> index 13fd8b5cd2..0b62c42851 100644
> --- a/tests/qemu-iotests/iotests.py
> +++ b/tests/qemu-iotests/iotests.py
> @@ -668,12 +668,16 @@ class VM(qtest.QEMUQtestMachine):
> }
> ]))
>
> - def wait_migration(self):
> + def wait_migration(self, expect_runstate):
> while True:
> event = self.event_wait('MIGRATION')
> log(event, filters=[filter_qmp_event])
> if event['data']['status'] == 'completed':
> break
> + # The event may occur in finish-migrate, so wait for the expected
> + # post-migration runstate
That's a bit too specific now that you have expect_runstate.
> + while self.qmp('query-status')['return']['status'] != expect_runstate:
> + pass
>
> def node_info(self, node_name):
> nodes = self.qmp('query-named-block-nodes')
Tested-by: Kevin Wolf <kwolf@redhat.com>
next prev parent reply other threads:[~2019-12-20 9:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-19 18:36 [PATCH v2] iotests.py: Let wait_migration wait even more Max Reitz
2019-12-20 9:32 ` Kevin Wolf [this message]
2019-12-20 9:52 ` Max Reitz
2019-12-20 10:07 ` Kevin Wolf
2019-12-20 10:18 ` Max Reitz
2019-12-23 23:15 ` John Snow
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=20191220093258.GB4019@dhcp-200-226.str.redhat.com \
--to=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--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 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).