From 191a72ef2a40d7bd14c5ad3745f1dfccbbf95817 Mon Sep 17 00:00:00 2001 From: Fiona Ebner Date: Fri, 30 May 2025 17:10:42 +0200 Subject: [PATCH 17/33] block: mark bdrv_parent_change_aio_context() GRAPH_RDLOCK RH-Author: Kevin Wolf RH-MergeRequest: 393: block: do not drain while holding the graph lock RH-Jira: RHEL-88561 RH-Acked-by: Stefan Hajnoczi RH-Acked-by: Hanna Czenczek RH-Commit: [5/21] e80d701ce609e823f85465a3433324cbf077b3b9 (kmwolf/centos-qemu-kvm) This is a small step in preparation to mark bdrv_drained_begin() as GRAPH_UNLOCKED. More concretely, it allows marking the change_aio_ctx() callback GRAPH_RDLOCK_PTR, which is the next step. Signed-off-by: Fiona Ebner Reviewed-by: Kevin Wolf Message-ID: <20250530151125.955508-6-f.ebner@proxmox.com> Signed-off-by: Kevin Wolf (cherry picked from commit 3758733959af93b5eb3283659d868ad5b24152b4) Signed-off-by: Kevin Wolf --- block.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index e340bac177..18a6be3bd6 100644 --- a/block.c +++ b/block.c @@ -7575,10 +7575,10 @@ typedef struct BdrvStateSetAioContext { BlockDriverState *bs; } BdrvStateSetAioContext; -static bool bdrv_parent_change_aio_context(BdrvChild *c, AioContext *ctx, - GHashTable *visited, - Transaction *tran, - Error **errp) +static bool GRAPH_RDLOCK +bdrv_parent_change_aio_context(BdrvChild *c, AioContext *ctx, + GHashTable *visited, Transaction *tran, + Error **errp) { GLOBAL_STATE_CODE(); if (g_hash_table_contains(visited, c)) { -- 2.39.3