yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-block-Remove-recursive-parameter-from-bdrv_drain_inv.patch

ae23c9
From 0e2a3eb5bd393ad4f22c5e492a7f81562eacb7d4 Mon Sep 17 00:00:00 2001
ae23c9
From: Kevin Wolf <kwolf@redhat.com>
ae23c9
Date: Wed, 10 Oct 2018 20:08:37 +0100
ae23c9
Subject: [PATCH 06/49] block: Remove 'recursive' parameter from
ae23c9
 bdrv_drain_invoke()
ae23c9
ae23c9
RH-Author: Kevin Wolf <kwolf@redhat.com>
ae23c9
Message-id: <20181010200843.6710-4-kwolf@redhat.com>
ae23c9
Patchwork-id: 82583
ae23c9
O-Subject: [RHEL-8 qemu-kvm PATCH 03/44] block: Remove 'recursive' parameter from bdrv_drain_invoke()
ae23c9
Bugzilla: 1637976
ae23c9
RH-Acked-by: Max Reitz <mreitz@redhat.com>
ae23c9
RH-Acked-by: John Snow <jsnow@redhat.com>
ae23c9
RH-Acked-by: Thomas Huth <thuth@redhat.com>
ae23c9
ae23c9
All callers pass false for the 'recursive' parameter now. Remove it.
ae23c9
ae23c9
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ae23c9
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
ae23c9
(cherry picked from commit 7d40d9ef9dfb4948a857bfc6ec8408eed1d1d9e7)
ae23c9
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
---
ae23c9
 block/io.c | 13 +++----------
ae23c9
 1 file changed, 3 insertions(+), 10 deletions(-)
ae23c9
ae23c9
diff --git a/block/io.c b/block/io.c
ae23c9
index 230b551..aa41f1e 100644
ae23c9
--- a/block/io.c
ae23c9
+++ b/block/io.c
ae23c9
@@ -167,9 +167,8 @@ static void coroutine_fn bdrv_drain_invoke_entry(void *opaque)
ae23c9
 }
ae23c9
 
ae23c9
 /* Recursively call BlockDriver.bdrv_co_drain_begin/end callbacks */
ae23c9
-static void bdrv_drain_invoke(BlockDriverState *bs, bool begin, bool recursive)
ae23c9
+static void bdrv_drain_invoke(BlockDriverState *bs, bool begin)
ae23c9
 {
ae23c9
-    BdrvChild *child, *tmp;
ae23c9
     BdrvCoDrainData data = { .bs = bs, .done = false, .begin = begin};
ae23c9
 
ae23c9
     if (!bs->drv || (begin && !bs->drv->bdrv_co_drain_begin) ||
ae23c9
@@ -180,12 +179,6 @@ static void bdrv_drain_invoke(BlockDriverState *bs, bool begin, bool recursive)
ae23c9
     data.co = qemu_coroutine_create(bdrv_drain_invoke_entry, &data);
ae23c9
     bdrv_coroutine_enter(bs, data.co);
ae23c9
     BDRV_POLL_WHILE(bs, !data.done);
ae23c9
-
ae23c9
-    if (recursive) {
ae23c9
-        QLIST_FOREACH_SAFE(child, &bs->children, next, tmp) {
ae23c9
-            bdrv_drain_invoke(child->bs, begin, true);
ae23c9
-        }
ae23c9
-    }
ae23c9
 }
ae23c9
 
ae23c9
 static bool bdrv_drain_recurse(BlockDriverState *bs)
ae23c9
@@ -286,7 +279,7 @@ void bdrv_do_drained_begin(BlockDriverState *bs, bool recursive,
ae23c9
     }
ae23c9
 
ae23c9
     bdrv_parent_drained_begin(bs, parent);
ae23c9
-    bdrv_drain_invoke(bs, true, false);
ae23c9
+    bdrv_drain_invoke(bs, true);
ae23c9
     bdrv_drain_recurse(bs);
ae23c9
 
ae23c9
     if (recursive) {
ae23c9
@@ -321,7 +314,7 @@ void bdrv_do_drained_end(BlockDriverState *bs, bool recursive,
ae23c9
     old_quiesce_counter = atomic_fetch_dec(&bs->quiesce_counter);
ae23c9
 
ae23c9
     /* Re-enable things in child-to-parent order */
ae23c9
-    bdrv_drain_invoke(bs, false, false);
ae23c9
+    bdrv_drain_invoke(bs, false);
ae23c9
     bdrv_parent_drained_end(bs, parent);
ae23c9
     if (old_quiesce_counter == 1) {
ae23c9
         aio_enable_external(bdrv_get_aio_context(bs));
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9