From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Greg Kurz <gkurz@linux.vnet.ibm.com>,
kwolf@redhat.com, mreitz@redhat.com, stefanha@redhat.com
Cc: Amit Shah <amit.shah@redhat.com>,
Juan Quintela <quintela@redhat.com>,
qemu-stable@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] migration: regain control of images when migration fails to complete
Date: Wed, 18 May 2016 12:13:04 +0100 [thread overview]
Message-ID: <20160518111303.GB2520@work-vm> (raw)
In-Reply-To: <146356663919.20589.15258524664873470668.stgit@bahia.huguette.org>
* Greg Kurz (gkurz@linux.vnet.ibm.com) wrote:
> We currently have an error path during migration that can cause
> the source QEMU to abort:
Hmm, wasn't there something similar recently, sorry I can't remember the details, but
cc'ing some block people who might remember.
Dave
>
> migration_thread()
> migration_completion()
> runstate_is_running() ----------------> true if guest is running
> bdrv_inactivate_all() ----------------> inactivate images
> qemu_savevm_state_complete_precopy()
> ... qemu_fflush()
> socket_writev_buffer() --------> error because destination fails
> qemu_fflush() -------------------> set error on migration stream
> migration_completion() -----------------> set migrate state to FAILED
> migration_thread() -----------------------> break migration loop
> vm_start() -----------------------------> restart guest with inactive
> images
>
> and you get:
>
> qemu-system-ppc64: socket_writev_buffer: Got err=104 for (32768/18446744073709551615)
> qemu-system-ppc64: /home/greg/Work/qemu/qemu-master/block/io.c:1342:bdrv_co_do_pwritev: Assertion `!(bs->open_flags & 0x0800)' failed.
> Aborted (core dumped)
>
> If we try postcopy with a similar scenario, we also get the writev error
> message but QEMU leaves the guest paused because entered_postcopy is true.
>
> We could possibly do the same with precopy and leave the guest paused.
> But since the historical default for migration errors is to restart the
> source, this patch adds a call to bdrv_invalidate_cache_all() instead.
>
> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> ---
> migration/migration.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/migration/migration.c b/migration/migration.c
> index 991313a8629a..5726959ddfd9 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -1568,8 +1568,17 @@ static void migration_completion(MigrationState *s, int current_active_state,
> ret = bdrv_inactivate_all();
> }
> if (ret >= 0) {
> + Error *local_err = NULL;
> +
> qemu_file_set_rate_limit(s->to_dst_file, INT64_MAX);
> qemu_savevm_state_complete_precopy(s->to_dst_file, false);
> +
> + if (qemu_file_get_error(s->to_dst_file)) {
> + bdrv_invalidate_cache_all(&local_err);
> + if (local_err) {
> + error_report_err(local_err);
> + }
> + }
> }
> }
> qemu_mutex_unlock_iothread();
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2016-05-18 11:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-18 10:18 [Qemu-devel] [PATCH] migration: regain control of images when migration fails to complete Greg Kurz
2016-05-18 11:13 ` Dr. David Alan Gilbert [this message]
2016-05-18 11:42 ` Kevin Wolf
2016-05-18 12:18 ` Greg Kurz
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=20160518111303.GB2520@work-vm \
--to=dgilbert@redhat.com \
--cc=amit.shah@redhat.com \
--cc=gkurz@linux.vnet.ibm.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@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).