diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2017-09-23 14:14:09 +0300 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2017-10-13 12:38:41 +0100 |
commit | 481cad48e5e655746893e001af31c161f4587a02 (patch) | |
tree | d60d2906b97eeccfe74e043c364aeed254a27192 /include/block | |
parent | f90ea7ba7c5ae7010ee0ce062207ae42530f57d6 (diff) | |
download | qemu-481cad48e5e655746893e001af31c161f4587a02.zip qemu-481cad48e5e655746893e001af31c161f4587a02.tar.gz qemu-481cad48e5e655746893e001af31c161f4587a02.tar.bz2 |
block: add bdrv_co_drain_end callback
BlockDriverState has a bdrv_co_drain() callback but no equivalent for
the end of the drain. The throttle driver (block/throttle.c) needs a way
to mark the end of the drain in order to toggle io_limits_disabled
correctly, thus bdrv_co_drain_end is needed.
Signed-off-by: Manos Pitsidianakis <el13635@mail.ntua.gr>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r-- | include/block/block_int.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h index 7e8a206..dd62f4d 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 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_end)(BlockDriverState *bs); void (*bdrv_add_child)(BlockDriverState *parent, BlockDriverState *child, Error **errp); |