Blame SOURCES/kvm-block-Fix-AioContext-switch-for-drained-node.patch

7711c0
From 3c3659acadf5891119a70e6dd7a2525c2706e1de Mon Sep 17 00:00:00 2001
7711c0
From: Kevin Wolf <kwolf@redhat.com>
7711c0
Date: Fri, 1 Mar 2019 14:27:45 +0100
7711c0
Subject: [PATCH 3/9] block: Fix AioContext switch for drained node
7711c0
7711c0
RH-Author: Kevin Wolf <kwolf@redhat.com>
7711c0
Message-id: <20190301142747.12251-4-kwolf@redhat.com>
7711c0
Patchwork-id: 84763
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 3/5] block: Fix AioContext switch for drained node
7711c0
Bugzilla: 1671173
7711c0
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
7711c0
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
7711c0
RH-Acked-by: John Snow <jsnow@redhat.com>
7711c0
7711c0
When a drained node changes its AioContext, we need to move its
7711c0
aio_disable_external() to the new context, too.
7711c0
7711c0
Without this fix, drain_end will try to reenable the new context, which
7711c0
has never been disabled, so an assertion failure is triggered.
7711c0
7711c0
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
7711c0
Reviewed-by: Eric Blake <eblake@redhat.com>
7711c0
(cherry picked from commit e64f25f30b80a71bd4e409ed518c39eeb5905166)
7711c0
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 block.c | 7 +++++++
7711c0
 1 file changed, 7 insertions(+)
7711c0
7711c0
diff --git a/block.c b/block.c
7711c0
index a69d0a2..7cd3651 100644
7711c0
--- a/block.c
7711c0
+++ b/block.c
7711c0
@@ -4954,6 +4954,9 @@ void bdrv_detach_aio_context(BlockDriverState *bs)
7711c0
         bdrv_detach_aio_context(child->bs);
7711c0
     }
7711c0
 
7711c0
+    if (bs->quiesce_counter) {
7711c0
+        aio_enable_external(bs->aio_context);
7711c0
+    }
7711c0
     bs->aio_context = NULL;
7711c0
 }
7711c0
 
7711c0
@@ -4967,6 +4970,10 @@ void bdrv_attach_aio_context(BlockDriverState *bs,
7711c0
         return;
7711c0
     }
7711c0
 
7711c0
+    if (bs->quiesce_counter) {
7711c0
+        aio_disable_external(new_context);
7711c0
+    }
7711c0
+
7711c0
     bs->aio_context = new_context;
7711c0
 
7711c0
     QLIST_FOREACH(child, &bs->children, next) {
7711c0
-- 
7711c0
1.8.3.1
7711c0