diff mbox

[3/4] virtio-blk: Use blk_drained_begin/end around dataplane stop

Message ID 1458123018-18651-4-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
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 hw/block/virtio-blk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index cb710f1..939ba79 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -653,11 +653,12 @@  static void virtio_blk_reset(VirtIODevice *vdev)
      */
     ctx = blk_get_aio_context(s->blk);
     aio_context_acquire(ctx);
-    blk_drain(s->blk);
+    blk_drained_begin(s->blk);
 
     if (s->dataplane) {
         virtio_blk_data_plane_stop(s->dataplane);
     }
+    blk_drained_end(s->blk);
     aio_context_release(ctx);
 
     blk_set_enable_write_cache(s->blk, s->original_wce);