thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-block-Remove-poll-parameter-from-bdrv_parent_drained.patch

ed5979
From 60b66881fb972e1cdff1cd7b4c865e5e21c141b0 Mon Sep 17 00:00:00 2001
ed5979
From: Kevin Wolf <kwolf@redhat.com>
ed5979
Date: Fri, 18 Nov 2022 18:41:10 +0100
ed5979
Subject: [PATCH 28/31] block: Remove poll parameter from
ed5979
 bdrv_parent_drained_begin_single()
ed5979
ed5979
RH-Author: Stefano Garzarella <sgarzare@redhat.com>
ed5979
RH-MergeRequest: 135: block: Simplify drain to prevent QEMU from crashing during snapshot
ed5979
RH-Bugzilla: 2155112
ed5979
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
ed5979
RH-Acked-by: Hanna Czenczek <hreitz@redhat.com>
ed5979
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
ed5979
RH-Commit: [16/16] fd526cc9e5bebeb256cfa56d23ec596f26caa37a (sgarzarella/qemu-kvm-c-9-s)
ed5979
ed5979
All callers of bdrv_parent_drained_begin_single() pass poll=false now,
ed5979
so we don't need the parameter any more.
ed5979
ed5979
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ed5979
Message-Id: <20221118174110.55183-16-kwolf@redhat.com>
ed5979
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
ed5979
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
ed5979
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ed5979
(cherry picked from commit 606ed756c1d69cba4822be8923248d2fd714f069)
ed5979
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
ed5979
---
ed5979
 block.c                  | 4 ++--
ed5979
 block/io.c               | 8 ++------
ed5979
 include/block/block-io.h | 5 ++---
ed5979
 3 files changed, 6 insertions(+), 11 deletions(-)
ed5979
ed5979
diff --git a/block.c b/block.c
ed5979
index 65588d313a..0d78711416 100644
ed5979
--- a/block.c
ed5979
+++ b/block.c
ed5979
@@ -2417,7 +2417,7 @@ static void bdrv_replace_child_abort(void *opaque)
ed5979
          * new_bs drained when calling bdrv_replace_child_tran() is not a
ed5979
          * requirement any more.
ed5979
          */
ed5979
-        bdrv_parent_drained_begin_single(s->child, false);
ed5979
+        bdrv_parent_drained_begin_single(s->child);
ed5979
         assert(!bdrv_parent_drained_poll_single(s->child));
ed5979
     }
ed5979
     assert(s->child->quiesced_parent);
ed5979
@@ -3059,7 +3059,7 @@ static BdrvChild *bdrv_attach_child_common(BlockDriverState *child_bs,
ed5979
      * a problem, we already did this), but it will still poll until the parent
ed5979
      * is fully quiesced, so it will not be negatively affected either.
ed5979
      */
ed5979
-    bdrv_parent_drained_begin_single(new_child, false);
ed5979
+    bdrv_parent_drained_begin_single(new_child);
ed5979
     bdrv_replace_child_noperm(new_child, child_bs);
ed5979
 
ed5979
     BdrvAttachChildCommonState *s = g_new(BdrvAttachChildCommonState, 1);
ed5979
diff --git a/block/io.c b/block/io.c
ed5979
index ae64830eac..38e57d1f67 100644
ed5979
--- a/block/io.c
ed5979
+++ b/block/io.c
ed5979
@@ -53,7 +53,7 @@ static void bdrv_parent_drained_begin(BlockDriverState *bs, BdrvChild *ignore)
ed5979
         if (c == ignore) {
ed5979
             continue;
ed5979
         }
ed5979
-        bdrv_parent_drained_begin_single(c, false);
ed5979
+        bdrv_parent_drained_begin_single(c);
ed5979
     }
ed5979
 }
ed5979
 
ed5979
@@ -105,9 +105,8 @@ static bool bdrv_parent_drained_poll(BlockDriverState *bs, BdrvChild *ignore,
ed5979
     return busy;
ed5979
 }
ed5979
 
ed5979
-void bdrv_parent_drained_begin_single(BdrvChild *c, bool poll)
ed5979
+void bdrv_parent_drained_begin_single(BdrvChild *c)
ed5979
 {
ed5979
-    AioContext *ctx = bdrv_child_get_parent_aio_context(c);
ed5979
     IO_OR_GS_CODE();
ed5979
 
ed5979
     assert(!c->quiesced_parent);
ed5979
@@ -116,9 +115,6 @@ void bdrv_parent_drained_begin_single(BdrvChild *c, bool poll)
ed5979
     if (c->klass->drained_begin) {
ed5979
         c->klass->drained_begin(c);
ed5979
     }
ed5979
-    if (poll) {
ed5979
-        AIO_WAIT_WHILE(ctx, bdrv_parent_drained_poll_single(c));
ed5979
-    }
ed5979
 }
ed5979
 
ed5979
 static void bdrv_merge_limits(BlockLimits *dst, const BlockLimits *src)
ed5979
diff --git a/include/block/block-io.h b/include/block/block-io.h
ed5979
index 65e6d2569b..92aaa7c1e9 100644
ed5979
--- a/include/block/block-io.h
ed5979
+++ b/include/block/block-io.h
ed5979
@@ -287,10 +287,9 @@ bdrv_writev_vmstate(BlockDriverState *bs, QEMUIOVector *qiov, int64_t pos);
ed5979
 /**
ed5979
  * bdrv_parent_drained_begin_single:
ed5979
  *
ed5979
- * Begin a quiesced section for the parent of @c. If @poll is true, wait for
ed5979
- * any pending activity to cease.
ed5979
+ * Begin a quiesced section for the parent of @c.
ed5979
  */
ed5979
-void bdrv_parent_drained_begin_single(BdrvChild *c, bool poll);
ed5979
+void bdrv_parent_drained_begin_single(BdrvChild *c);
ed5979
 
ed5979
 /**
ed5979
  * bdrv_parent_drained_poll_single:
ed5979
-- 
ed5979
2.31.1
ed5979