From: Max Reitz <mreitz@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] block: use drained section in bdrv_close
Date: Wed, 23 Dec 2015 22:31:34 +0100 [thread overview]
Message-ID: <567B12B6.7030308@redhat.com> (raw)
In-Reply-To: <1450867706-19860-2-git-send-email-pbonzini@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]
On 23.12.2015 11:48, Paolo Bonzini wrote:
> bdrv_close is used when ejecting a medium.
Is it still? Other than it maybe being indirectly called through
bdrv_delete(), it shouldn't be.
> Use a drained section to ensure
> that all I/O goes to either the old medium or the bitbucket.
Since the BDS will be deleted after bdrv_close() has been called, where
else would the I/O go now?
Max
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> block.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/block.c b/block.c
> index 411edbf..01655de 100644
> --- a/block.c
> +++ b/block.c
> @@ -2154,9 +2154,10 @@ void bdrv_close(BlockDriverState *bs)
> bdrv_io_limits_disable(bs);
> }
>
> - bdrv_drain(bs); /* complete I/O */
> + bdrv_drained_begin(bs); /* complete I/O */
> bdrv_flush(bs);
> bdrv_drain(bs); /* in case flush left pending I/O */
> +
> notifier_list_notify(&bs->close_notifiers, bs);
>
> if (bs->blk) {
> @@ -2206,6 +2207,7 @@ void bdrv_close(BlockDriverState *bs)
> g_free(ban);
> }
> QLIST_INIT(&bs->aio_notifiers);
> + bdrv_drained_end(bs);
> }
>
> void bdrv_close_all(void)
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-12-23 21:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 10:48 [Qemu-devel] [PATCH] block: use drained section in bdrv_close Paolo Bonzini
2015-12-23 21:31 ` Max Reitz [this message]
2015-12-23 21:55 ` [Qemu-devel] [Qemu-block] " Paolo Bonzini
2015-12-23 22:17 ` Max Reitz
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=567B12B6.7030308@redhat.com \
--to=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@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 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).