From: Thomas Huth <thuth@redhat.com>
To: Nico Boehr <nrb@linux.ibm.com>,
frankja@linux.ibm.com, imbrenda@linux.ibm.com,
pbonzini@redhat.com, andrew.jones@linux.dev
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH v1] arch-run: migration: properly handle crashing outgoing QEMU
Date: Mon, 9 Oct 2023 13:29:38 +0200 [thread overview]
Message-ID: <082a6b8b-6138-bf42-3f5e-0c2995bfe382@redhat.com> (raw)
In-Reply-To: <20230926120828.1830840-1-nrb@linux.ibm.com>
On 26/09/2023 14.08, Nico Boehr wrote:
> When outgoing (live) QEMU crashes or times out during migration, we
> currently hang forever.
>
> This is because we don't exit the loop querying migration state when QMP
> communication fails.
>
> Add proper error handling to the loop and exit when QMP communication
> fails for whatever reason.
>
> Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
> ---
> Sorry I accidentally sent this only to s390x maintainers and forgot
> Paolo and Andrew, hence resending.
>
> scripts/arch-run.bash | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
> index 518607f4b75d..de9890408e24 100644
> --- a/scripts/arch-run.bash
> +++ b/scripts/arch-run.bash
> @@ -162,8 +162,14 @@ run_migration ()
> migstatus=`qmp ${qmp1} '"query-migrate"' | grep return`
> while ! grep -q '"completed"' <<<"$migstatus" ; do
> sleep 1
> - migstatus=`qmp ${qmp1} '"query-migrate"' | grep return`
> - if grep -q '"failed"' <<<"$migstatus" ; then
> + if ! migstatus=`qmp ${qmp1} '"query-migrate"'`; then
> + echo "ERROR: Querying migration state failed." >&2
> + echo > ${fifo}
> + qmp ${qmp2} '"quit"'> ${qmpout2} 2>/dev/null
> + return 2
> + fi
> + migstatus=`grep return <<<"$migstatus"`
> + if grep -q '"failed"' <<<"$migstatus"; then
> echo "ERROR: Migration failed." >&2
> echo > ${fifo}
> qmp ${qmp1} '"quit"'> ${qmpout1} 2>/dev/null
Reviewed-by: Thomas Huth <thuth@redhat.com>
and pushed to the repository.
next prev parent reply other threads:[~2023-10-09 11:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-26 12:08 [kvm-unit-tests PATCH v1] arch-run: migration: properly handle crashing outgoing QEMU Nico Boehr
2023-10-09 11:29 ` Thomas Huth [this message]
2023-10-09 14:33 ` Nico Boehr
-- strict thread matches above, loose matches on Subject: below --
2023-09-26 11:18 Nico Boehr
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=082a6b8b-6138-bf42-3f5e-0c2995bfe382@redhat.com \
--to=thuth@redhat.com \
--cc=andrew.jones@linux.dev \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=nrb@linux.ibm.com \
--cc=pbonzini@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