aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-10-16 14:28:13 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-10-16 14:28:13 +0100
commit48ae1f60d8c9a770e6da64407984d84e25253c69 (patch)
tree0099e6e4dba3caaeac912033ae3bac0dabf9b64d /include
parent78b62d37669230fbc4cb1e780cf33713dfd740ca (diff)
parentb867eaa17b3940760f51134e409cb0580dd3dde3 (diff)
downloadqemu-48ae1f60d8c9a770e6da64407984d84e25253c69.zip
qemu-48ae1f60d8c9a770e6da64407984d84e25253c69.tar.gz
qemu-48ae1f60d8c9a770e6da64407984d84e25253c69.tar.bz2
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
# gpg: Signature made Fri 13 Oct 2017 14:49:22 BST # gpg: using RSA key 0x9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: block/throttle.c: add bdrv_co_drain_begin/end callbacks block: rename bdrv_co_drain to bdrv_co_drain_begin block: add bdrv_co_drain_end callback Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/block/block_int.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 7e8a206..885c08e 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -354,10 +354,17 @@ struct BlockDriver {
int (*bdrv_probe_geometry)(BlockDriverState *bs, HDGeometry *geo);
/**
- * Drain and stop any internal sources of requests in the driver, and
- * remain so until next I/O callback (e.g. bdrv_co_writev) is called.
+ * bdrv_co_drain_begin is called if implemented in the beginning of a
+ * drain operation to drain and stop any internal sources of requests in
+ * the driver.
+ * bdrv_co_drain_end is called if implemented at the end of the drain.
+ *
+ * They should be used by the driver to e.g. manage scheduled I/O
+ * requests, or toggle an internal state. After the end of the drain new
+ * requests will continue normally.
*/
- void coroutine_fn (*bdrv_co_drain)(BlockDriverState *bs);
+ void coroutine_fn (*bdrv_co_drain_begin)(BlockDriverState *bs);
+ void coroutine_fn (*bdrv_co_drain_end)(BlockDriverState *bs);
void (*bdrv_add_child)(BlockDriverState *parent, BlockDriverState *child,
Error **errp);