thebeanogamer / rpms / qemu-kvm

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