All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, mreitz@redhat.com, qemu-stable@nongnu.org,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 2/2] qemu: use bdrv_flush_all for vm_stop et al
Date: Fri, 16 Sep 2016 12:17:56 -0400	[thread overview]
Message-ID: <5ece6914-5fa2-bb3a-6e1b-62b6a9ac625a@redhat.com> (raw)
In-Reply-To: <1473982972-8884-3-git-send-email-jsnow@redhat.com>



On 09/15/2016 07:42 PM, John Snow wrote:
> Bypass the usual check to see if we are "allowed" to flush via the
> block model, and manually flush the BDS nodes themselves instead.
>
> This allows us to do things like migrate when we have a device with
> an open tray, but has a node that may need to be flushed.
>
> Specifically, this allows us to migrate when we have a CDROM with
> an open tray.
>

How about:

Reimplement bdrv_flush_all for vm_stop. In contrast to blk_flush_all,
bdrv_flush_all does not have device model restrictions. This allows
us to flush and halt unconditionally without error.

This allows us to do things like migrate when we have a device with
an open tray, but has a node that may need to be flushed.

Specifically, this allows us to migrate when we have a CDROM with
an open tray.

> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  cpus.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/cpus.c b/cpus.c
> index e39ccb7..96d9352 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -751,7 +751,7 @@ static int do_vm_stop(RunState state)
>      }
>
>      bdrv_drain_all();
> -    ret = blk_flush_all();
> +    ret = bdrv_flush_all();
>
>      return ret;
>  }
> @@ -1494,7 +1494,7 @@ int vm_stop_force_state(RunState state)
>          bdrv_drain_all();
>          /* Make sure to return an error if the flush in a previous vm_stop()
>           * failed. */
> -        return blk_flush_all();
> +        return bdrv_flush_all();
>      }
>  }
>
>

  reply	other threads:[~2016-09-16 16:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-15 23:42 [Qemu-devel] [PATCH v3 0/2] block: allow flush on devices with open tray John Snow
2016-09-15 23:42 ` [Qemu-devel] [PATCH v3 1/2] block: reintroduce bdrv_flush_all John Snow
2016-09-15 23:42 ` [Qemu-devel] [PATCH v3 2/2] qemu: use bdrv_flush_all for vm_stop et al John Snow
2016-09-16 16:17   ` John Snow [this message]
2016-09-19  8:01     ` Kevin Wolf
2016-09-16  0:06 ` [Qemu-devel] [PATCH v3 0/2] block: allow flush on devices with open tray Paolo Bonzini
2016-09-16  0:09   ` John Snow
2016-09-16  0:10     ` Paolo Bonzini
2016-09-16  8:33 ` Kevin Wolf
2016-09-16 15:59   ` 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=5ece6914-5fa2-bb3a-6e1b-62b6a9ac625a@redhat.com \
    --to=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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 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.