diff mbox series

[v2,6/9] block: Add bdrv_drained_end_no_poll()

Message ID 20190619152603.5937-7-mreitz@redhat.com (mailing list archive)
State New, archived
Headers show
Series block: Delay poll when ending drained sections | expand

Commit Message

Max Reitz June 19, 2019, 3:26 p.m. UTC
In contrast to bdrv_drained_end(), which does poll and may thus lead to
graph changes, this new interface to bdrv_do_drained_end() will not
poll.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 include/block/block.h | 12 +++++++++++-
 block/io.c            |  5 +++++
 2 files changed, 16 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/block/block.h b/include/block/block.h
index d98237f0f1..422448d773 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -680,10 +680,20 @@  void bdrv_subtree_drained_begin(BlockDriverState *bs);
 /**
  * bdrv_drained_end:
  *
- * End a quiescent section started by bdrv_drained_begin().
+ * End a quiescent section started by bdrv_drained_begin().  This may
+ * result in block graph changes.
  */
 void bdrv_drained_end(BlockDriverState *bs);
 
+/**
+ * bdrv_drained_end_no_poll:
+ *
+ * Same as bdrv_drained_end(), but do not poll for the subgraph to
+ * actually become unquiesced.  Therefore, no graph changes will occur
+ * with this function.
+ */
+void bdrv_drained_end_no_poll(BlockDriverState *bs);
+
 /**
  * End a quiescent section started by bdrv_subtree_drained_begin().
  */
diff --git a/block/io.c b/block/io.c
index 5f30baa8e5..188dea22bc 100644
--- a/block/io.c
+++ b/block/io.c
@@ -539,6 +539,11 @@  void bdrv_drained_end(BlockDriverState *bs)
     bdrv_do_drained_end(bs, false, NULL, false, true, NULL);
 }
 
+void bdrv_drained_end_no_poll(BlockDriverState *bs)
+{
+    bdrv_do_drained_end(bs, false, NULL, false, false, NULL);
+}
+
 void bdrv_subtree_drained_end(BlockDriverState *bs)
 {
     bdrv_do_drained_end(bs, true, NULL, false, true, NULL);