mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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>
This commit is contained in:
parent
f90ea7ba7c
commit
481cad48e5
2 changed files with 43 additions and 16 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue