diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-04-07 18:33:34 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-05-12 15:22:07 +0200 |
commit | 6b98bd649520d07df4d1b7a0a54ac73bf178519c (patch) | |
tree | 22924e241859dcc57d55fdb1d71c8f4220313633 /include/block/block_int.h | |
parent | ce0f141259f06fd77fde2519cc352618ad797ce2 (diff) | |
download | qemu-6b98bd649520d07df4d1b7a0a54ac73bf178519c.zip qemu-6b98bd649520d07df4d1b7a0a54ac73bf178519c.tar.gz qemu-6b98bd649520d07df4d1b7a0a54ac73bf178519c.tar.bz2 |
block: plug whole tree at once, introduce bdrv_io_unplugged_begin/end
Extract the handling of io_plug "depth" from linux-aio.c and let the
main bdrv_drain loop do nothing but wait on I/O.
Like the two newly introduced functions, bdrv_io_plug and bdrv_io_unplug
now operate on all children. The visit order is now symmetrical between
plug and unplug, making it possible for formats to implement plug/unplug.
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block/block_int.h')
-rw-r--r-- | include/block/block_int.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h index ed9314b..f1aabb9 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -294,7 +294,6 @@ struct BlockDriver { /* io queue for linux-aio */ void (*bdrv_io_plug)(BlockDriverState *bs); void (*bdrv_io_unplug)(BlockDriverState *bs); - void (*bdrv_flush_io_queue)(BlockDriverState *bs); /** * Try to get @bs's logical and physical block size. @@ -484,6 +483,10 @@ struct BlockDriverState { uint64_t write_threshold_offset; NotifierWithReturn write_threshold_notifier; + /* counters for nested bdrv_io_plug and bdrv_io_unplugged_begin */ + unsigned io_plugged; + unsigned io_plug_disabled; + int quiesce_counter; }; |