diff options
author | Kevin Wolf <kwolf@redhat.com> | 2017-12-07 13:03:13 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-12-22 15:05:32 +0100 |
commit | 0152bf400fe3ca7facb382683bfcccda70ebf51a (patch) | |
tree | 3070ead9a8a8785dd3ddd726046c60e95c678185 /include/block | |
parent | 6c429a6a97d183aeb2c00f8680aaf3d9e900359d (diff) | |
download | qemu-0152bf400fe3ca7facb382683bfcccda70ebf51a.zip qemu-0152bf400fe3ca7facb382683bfcccda70ebf51a.tar.gz qemu-0152bf400fe3ca7facb382683bfcccda70ebf51a.tar.bz2 |
block: Don't notify parents in drain call chain
This is in preparation for subtree drains, i.e. drained sections that
affect not only a single node, but recursively all child nodes, too.
Calling the parent callbacks for drain is pointless when we just came
from that parent node recursively and leads to multiple increases of
bs->quiesce_counter in a single drain call. Don't do it.
In order for this to work correctly, the parent callback must be called
for every bdrv_drain_begin/end() call, not only for the outermost one:
If we have a node N with two parents A and B, recursive draining of A
should cause the quiesce_counter of B to increase because its child N is
drained independently of B. If now B is recursively drained, too, A must
increase its quiesce_counter because N is drained independently of A
only now, even if N is going from quiesce_counter 1 to 2.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r-- | include/block/block.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/block/block.h b/include/block/block.h index c05cac5..60c5d11 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -585,7 +585,7 @@ void bdrv_io_unplug(BlockDriverState *bs); * Begin a quiesced section of all users of @bs. This is part of * bdrv_drained_begin. */ -void bdrv_parent_drained_begin(BlockDriverState *bs); +void bdrv_parent_drained_begin(BlockDriverState *bs, BdrvChild *ignore); /** * bdrv_parent_drained_end: @@ -593,7 +593,7 @@ void bdrv_parent_drained_begin(BlockDriverState *bs); * End a quiesced section of all users of @bs. This is part of * bdrv_drained_end. */ -void bdrv_parent_drained_end(BlockDriverState *bs); +void bdrv_parent_drained_end(BlockDriverState *bs, BdrvChild *ignore); /** * bdrv_drained_begin: |