- kvm-migration-multifd-move-macros-to-multifd-header.patch [RHEL-59697] - kvm-migration-refactor-channel-discovery-mechanism.patch [RHEL-59697] - kvm-migration-Add-save_postcopy_prepare-savevm-handler.patch [RHEL-59697] - kvm-migration-ram-Implement-save_postcopy_prepare.patch [RHEL-59697] - kvm-tests-qtest-migration-consolidate-set-capabilities.patch [RHEL-59697] - kvm-migration-write-zero-pages-when-postcopy-enabled.patch [RHEL-59697] - kvm-migration-enable-multifd-and-postcopy-together.patch [RHEL-59697] - kvm-migration-Add-qtest-for-migration-over-RDMA.patch [RHEL-59697] - kvm-qtest-migration-rdma-Enforce-RLIMIT_MEMLOCK-128MB-re.patch [RHEL-59697] - kvm-qtest-migration-rdma-Add-test-for-rdma-migration-wit.patch [RHEL-59697] - kvm-tests-qtest-migration-add-postcopy-tests-with-multif.patch [RHEL-59697] - kvm-file-posix-Fix-aio-threads-performance-regression-af.patch [RHEL-96854] - kvm-block-remove-outdated-comments-about-AioContext-lock.patch [RHEL-88561] - kvm-block-move-drain-outside-of-read-locked-bdrv_reopen_.patch [RHEL-88561] - kvm-block-snapshot-move-drain-outside-of-read-locked-bdr.patch [RHEL-88561] - kvm-block-move-drain-outside-of-read-locked-bdrv_inactiv.patch [RHEL-88561] - kvm-block-mark-bdrv_parent_change_aio_context-GRAPH_RDLO.patch [RHEL-88561] - kvm-block-mark-change_aio_ctx-callback-and-instances-as-.patch [RHEL-88561] - kvm-block-mark-bdrv_child_change_aio_context-GRAPH_RDLOC.patch [RHEL-88561] - kvm-block-move-drain-outside-of-bdrv_change_aio_context-.patch [RHEL-88561] - kvm-block-move-drain-outside-of-bdrv_try_change_aio_cont.patch [RHEL-88561] - kvm-block-move-drain-outside-of-bdrv_attach_child_common.patch [RHEL-88561] - kvm-block-move-drain-outside-of-bdrv_set_backing_hd_drai.patch [RHEL-88561] - kvm-block-move-drain-outside-of-bdrv_root_attach_child.patch [RHEL-88561] - kvm-block-move-drain-outside-of-bdrv_attach_child.patch [RHEL-88561] - kvm-block-move-drain-outside-of-quorum_add_child.patch [RHEL-88561] - kvm-block-move-drain-outside-of-bdrv_root_unref_child.patch [RHEL-88561] - kvm-block-move-drain-outside-of-quorum_del_child.patch [RHEL-88561] - kvm-blockdev-drain-while-unlocked-in-internal_snapshot_a.patch [RHEL-88561] - kvm-blockdev-drain-while-unlocked-in-external_snapshot_a.patch [RHEL-88561] - kvm-block-mark-bdrv_drained_begin-and-friends-as-GRAPH_U.patch [RHEL-88561] - kvm-iotests-graph-changes-while-io-remove-image-file-aft.patch [RHEL-88561] - kvm-iotests-graph-changes-while-io-add-test-case-with-re.patch [RHEL-88561] - Resolves: RHEL-59697 (Allow multifd+postcopy features being enabled together, but only use multifd during precopy ) - Resolves: RHEL-96854 (Performance Degradation(aio=threads) between Upstream Commit b75c5f9 and 984a32f) - Resolves: RHEL-88561 (qemu graph deadlock during job-dismiss)
71 lines
2.4 KiB
Diff
71 lines
2.4 KiB
Diff
From 96407f6d729312c373e9b2ccbf97918d453c7a52 Mon Sep 17 00:00:00 2001
|
|
From: Fiona Ebner <f.ebner@proxmox.com>
|
|
Date: Fri, 30 May 2025 17:10:55 +0200
|
|
Subject: [PATCH 30/33] blockdev: drain while unlocked in
|
|
external_snapshot_action()
|
|
|
|
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
RH-MergeRequest: 393: block: do not drain while holding the graph lock
|
|
RH-Jira: RHEL-88561
|
|
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
RH-Acked-by: Hanna Czenczek <hreitz@redhat.com>
|
|
RH-Commit: [18/21] b651de913db70b4897f0085af696cdaf925f5f81 (kmwolf/centos-qemu-kvm)
|
|
|
|
This is in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED.
|
|
|
|
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
|
|
Message-ID: <20250530151125.955508-19-f.ebner@proxmox.com>
|
|
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
|
|
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
(cherry picked from commit 195a8a946a8681dfe7e8aa8d49db415693db5311)
|
|
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
---
|
|
blockdev.c | 17 ++++++++++++++++-
|
|
1 file changed, 16 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/blockdev.c b/blockdev.c
|
|
index 2560a11a53..998dbe38a5 100644
|
|
--- a/blockdev.c
|
|
+++ b/blockdev.c
|
|
@@ -1377,9 +1377,10 @@ static void external_snapshot_action(TransactionAction *action,
|
|
const char *new_image_file;
|
|
ExternalSnapshotState *state = g_new0(ExternalSnapshotState, 1);
|
|
uint64_t perm, shared;
|
|
+ BlockDriverState *check_bs;
|
|
|
|
/* TODO We'll eventually have to take a writer lock in this function */
|
|
- GRAPH_RDLOCK_GUARD_MAINLOOP();
|
|
+ bdrv_graph_rdlock_main_loop();
|
|
|
|
tran_add(tran, &external_snapshot_drv, state);
|
|
|
|
@@ -1412,11 +1413,25 @@ static void external_snapshot_action(TransactionAction *action,
|
|
|
|
state->old_bs = bdrv_lookup_bs(device, node_name, errp);
|
|
if (!state->old_bs) {
|
|
+ bdrv_graph_rdunlock_main_loop();
|
|
return;
|
|
}
|
|
|
|
+ /* Need to drain while unlocked. */
|
|
+ bdrv_graph_rdunlock_main_loop();
|
|
/* Paired with .clean() */
|
|
bdrv_drained_begin(state->old_bs);
|
|
+ GRAPH_RDLOCK_GUARD_MAINLOOP();
|
|
+
|
|
+ /* Make sure the associated bs did not change with the drain. */
|
|
+ check_bs = bdrv_lookup_bs(device, node_name, errp);
|
|
+ if (state->old_bs != check_bs) {
|
|
+ if (check_bs) {
|
|
+ error_setg(errp, "Block node of device '%s' unexpectedly changed",
|
|
+ device);
|
|
+ } /* else errp is already set */
|
|
+ return;
|
|
+ }
|
|
|
|
if (!bdrv_is_inserted(state->old_bs)) {
|
|
error_setg(errp, "Device '%s' has no medium",
|
|
--
|
|
2.39.3
|
|
|