[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 03/21] block: use drained section in bdrv_close
From: |
Max Reitz |
Subject: |
[Qemu-block] [PULL 03/21] block: use drained section in bdrv_close |
Date: |
Thu, 7 Jan 2016 23:57:17 +0100 |
From: Paolo Bonzini <address@hidden>
bdrv_close is used when ejecting a medium. Use a drained section to ensure
that all I/O goes to either the old medium or the bitbucket.
Signed-off-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
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)
--
2.6.4
- [Qemu-block] [PULL 00/21] Block layer patches, Max Reitz, 2016/01/07
- [Qemu-block] [PULL 01/21] iotests: 086: Add raw format, Max Reitz, 2016/01/07
- [Qemu-block] [PULL 02/21] qemu-iotests: make check-block.sh work on out-of-tree builds, Max Reitz, 2016/01/07
- [Qemu-block] [PULL 03/21] block: use drained section in bdrv_close,
Max Reitz <=
- [Qemu-block] [PULL 04/21] block/qapi: Clear err for further error, Max Reitz, 2016/01/07
- [Qemu-block] [PULL 05/21] iotests: 018: Use TEST_IMG override instead of "mv", Max Reitz, 2016/01/07
- [Qemu-block] [PULL 06/21] iotests: 019: Use TEST_IMG override instead of "mv", Max Reitz, 2016/01/07
- [Qemu-block] [PULL 07/21] iotests: 020: Use TEST_IMG override instead of "mv", Max Reitz, 2016/01/07
- [Qemu-block] [PULL 08/21] iotests: 024: Use TEST_IMG override instead of "mv", Max Reitz, 2016/01/07
- [Qemu-block] [PULL 09/21] iotests: 028: Use TEST_IMG override instead of "mv", Max Reitz, 2016/01/07
- [Qemu-block] [PULL 10/21] iotests: 034: Use TEST_IMG override instead of "mv", Max Reitz, 2016/01/07
- [Qemu-block] [PULL 11/21] iotests: 037: Use TEST_IMG override instead of "mv", Max Reitz, 2016/01/07
- [Qemu-block] [PULL 12/21] iotests: 038: Use TEST_IMG override instead of "mv", Max Reitz, 2016/01/07
- [Qemu-block] [PULL 13/21] iotests: 050: Use TEST_IMG override instead of "mv", Max Reitz, 2016/01/07