From: Hailiang Zhang <zhang.zhanghailiang@huawei.com>
To: quintela@redhat.com, amit.shah@redhat.com
Cc: qemu-devel@nongnu.org, qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] migration: re-active images when migration fails to complete
Date: Mon, 21 Nov 2016 19:12:21 +0800 [thread overview]
Message-ID: <5832D695.1040208@huawei.com> (raw)
In-Reply-To: <1479555831-30960-1-git-send-email-zhang.zhanghailiang@huawei.com>
Cc: qemu-stable@nongnu.org
On 2016/11/19 19:43, zhanghailiang wrote:
> commit fe904ea8242cbae2d7e69c052c754b8f5f1ba1d6 fixed a case
> which migration aborted QEMU because it didn't regain the control
> of images while some errors happened.
>
> Actually, we have another case in that error path to abort QEMU
> because of the same reason:
> migration_thread()
> migration_completion()
> bdrv_inactivate_all() ----------------> inactivate images
> qemu_savevm_state_complete_precopy()
> socket_writev_buffer() --------> error because destination fails
> qemu_fflush() -------------------> set error on migration stream
> qemu_mutex_unlock_iothread() ------> unlock
> qmp_migrate_cancel() ---------------------> user cancelled migration
> migrate_set_state() ------------------> set migrate CANCELLING
> migration_completion() -----------------> go on to fail_invalidate
> if (s->state == MIGRATION_STATUS_ACTIVE) -> Jump this branch
> migration_thread() -----------------------> break migration loop
> vm_start() -----------------------------> restart guest with inactive
> images
> We failed to regain the control of images because we only regain it
> while the migration state is "active", but here users cancelled the migration
> when they found some errors happened (for example, libvirtd daemon is shutdown
> in destination unexpectedly).
>
> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
> ---
> migration/migration.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/migration/migration.c b/migration/migration.c
> index f498ab8..0c1ee6d 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -1752,7 +1752,8 @@ fail_invalidate:
> /* If not doing postcopy, vm_start() will be called: let's regain
> * control on images.
> */
> - if (s->state == MIGRATION_STATUS_ACTIVE) {
> + if (s->state == MIGRATION_STATUS_ACTIVE ||
> + s->state == MIGRATION_STATUS_CANCELLING) {
> Error *local_err = NULL;
>
> bdrv_invalidate_cache_all(&local_err);
>
next prev parent reply other threads:[~2016-11-21 11:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-19 11:43 [Qemu-devel] [PATCH] migration: re-active images when migration fails to complete zhanghailiang
2016-11-21 11:12 ` Hailiang Zhang [this message]
2016-12-01 14:30 ` Kevin Wolf
2016-12-06 13:42 ` Kevin Wolf
2016-12-06 14:30 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-12-06 15:24 ` [Qemu-devel] " Dr. David Alan Gilbert
2016-12-08 5:35 ` Hailiang Zhang
2016-12-08 20:02 ` Dr. David Alan Gilbert
2016-12-22 2:56 ` Hailiang Zhang
2016-12-27 10:38 ` Hailiang Zhang
2017-01-11 5:22 ` Hailiang Zhang
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=5832D695.1040208@huawei.com \
--to=zhang.zhanghailiang@huawei.com \
--cc=amit.shah@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=quintela@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.