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

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