diff mbox

[2/4] block-backend: Introduce blk_drained_begin/end

Message ID 1458123018-18651-3-git-send-email-famz@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Fam Zheng March 16, 2016, 10:10 a.m. UTC
They forward the call to bdrv_* counterparts.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 block/block-backend.c          | 14 ++++++++++++++
 include/sysemu/block-backend.h |  2 ++
 2 files changed, 16 insertions(+)
diff mbox

Patch

diff --git a/block/block-backend.c b/block/block-backend.c
index 03e71b4..d686a63 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -891,6 +891,20 @@  void blk_drain(BlockBackend *blk)
     }
 }
 
+void blk_drained_begin(BlockBackend *blk)
+{
+    if (blk->bs) {
+        bdrv_drained_begin(blk->bs);
+    }
+}
+
+void blk_drained_end(BlockBackend *blk)
+{
+    if (blk->bs) {
+        bdrv_drained_end(blk->bs);
+    }
+}
+
 void blk_drain_all(void)
 {
     bdrv_drain_all();
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
index 00d69ba..2cd53d0 100644
--- a/include/sysemu/block-backend.h
+++ b/include/sysemu/block-backend.h
@@ -128,6 +128,8 @@  int blk_co_flush(BlockBackend *blk);
 int blk_flush(BlockBackend *blk);
 int blk_flush_all(void);
 void blk_drain(BlockBackend *blk);
+void blk_drained_begin(BlockBackend *blk);
+void blk_drained_end(BlockBackend *blk);
 void blk_drain_all(void);
 void blk_set_on_error(BlockBackend *blk, BlockdevOnError on_read_error,
                       BlockdevOnError on_write_error);