From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, quintela@redhat.com, famz@redhat.com,
kwolf@redhat.com, jdenemar@redhat.com, peterx@redhat.com
Subject: Re: [Qemu-devel] [PATCH] migration: Don't activate block devices if using -S
Date: Thu, 29 Mar 2018 10:45:33 +0100 [thread overview]
Message-ID: <20180329094533.GB6245@work-vm> (raw)
In-Reply-To: <20180328170207.49512-1-dgilbert@redhat.com>
* Dr. David Alan Gilbert (git) (dgilbert@redhat.com) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Activating the block devices causes the locks to be taken on
> the backing file. If we're running with -S and the destination libvirt
> hasn't started the destination with 'cont', it's expecting the locks are
> still untaken.
>
> Don't activate the block devices if we're not going to autostart the VM;
> 'cont' already will do that anyway.
>
> bz: https://bugzilla.redhat.com/show_bug.cgi?id=1560854
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Queued
> ---
> migration/migration.c | 22 +++++++++++++++-------
> 1 file changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/migration/migration.c b/migration/migration.c
> index 52a5092add..58bd382730 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -306,13 +306,21 @@ static void process_incoming_migration_bh(void *opaque)
> Error *local_err = NULL;
> MigrationIncomingState *mis = opaque;
>
> - /* Make sure all file formats flush their mutable metadata.
> - * If we get an error here, just don't restart the VM yet. */
> - bdrv_invalidate_cache_all(&local_err);
> - if (local_err) {
> - error_report_err(local_err);
> - local_err = NULL;
> - autostart = false;
> + /* Only fire up the block code now if we're going to restart the
> + * VM, else 'cont' will do it.
> + * This causes file locking to happen; so we don't want it to happen
> + * unless we really are starting the VM.
> + */
> + if (autostart && (!global_state_received() ||
> + global_state_get_runstate() == RUN_STATE_RUNNING)) {
> + /* Make sure all file formats flush their mutable metadata.
> + * If we get an error here, just don't restart the VM yet. */
> + bdrv_invalidate_cache_all(&local_err);
> + if (local_err) {
> + error_report_err(local_err);
> + local_err = NULL;
> + autostart = false;
> + }
> }
>
> /*
> --
> 2.14.3
>
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2018-03-29 9:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-28 17:02 [Qemu-devel] [PATCH] migration: Don't activate block devices if using -S Dr. David Alan Gilbert (git)
2018-03-28 17:38 ` [Qemu-devel] [PATCH for-2.12] " Eric Blake
2018-03-29 9:45 ` Dr. David Alan Gilbert [this message]
2018-03-31 7:56 ` [Qemu-devel] [PATCH] " no-reply
2018-04-03 14:38 ` Kevin Wolf
2018-04-03 20:52 ` Dr. David Alan Gilbert
2018-04-04 10:03 ` Kevin Wolf
2018-04-09 10:27 ` Dr. David Alan Gilbert
2018-04-09 13:40 ` Kevin Wolf
2018-04-09 14:04 ` Dr. David Alan Gilbert
2018-04-09 15:25 ` Kevin Wolf
2018-04-09 15:35 ` Dr. David Alan Gilbert
2018-04-10 7:36 ` Jiri Denemark
2018-04-10 8:18 ` Kevin Wolf
2018-04-10 8:45 ` Dr. David Alan Gilbert
2018-04-10 9:14 ` Kevin Wolf
2018-04-10 10:40 ` Dr. David Alan Gilbert
2018-04-10 12:26 ` Kevin Wolf
2018-04-10 14:22 ` Dr. David Alan Gilbert
2018-04-10 14:47 ` Kevin Wolf
2018-04-11 10:01 ` Jiri Denemark
2018-04-11 12:49 ` Kevin Wolf
2018-04-11 13:12 ` Dr. David Alan Gilbert
2018-04-09 15:28 ` Jiri Denemark
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=20180329094533.GB6245@work-vm \
--to=dgilbert@redhat.com \
--cc=famz@redhat.com \
--cc=jdenemar@redhat.com \
--cc=kwolf@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@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 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).