From: Fiona Ebner Date: Fri, 30 May 2025 15:11:04 +0000 (+0200) Subject: block: call bdrv_set_backing_hd() while unlocked in bdrv_open_backing_file() X-Git-Tag: v10.1.0-rc0~13^2~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7573eba14b214d20340eed6880fb8f5cf90d051;p=thirdparty%2Fqemu.git block: call bdrv_set_backing_hd() while unlocked in bdrv_open_backing_file() This is in preparation to mark bdrv_set_backing_hd() as GRAPH_UNLOCKED. Signed-off-by: Fiona Ebner Message-ID: <20250530151125.955508-28-f.ebner@proxmox.com> [kwolf: Removed an extra blank line] Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- diff --git a/block.c b/block.c index 1da10d55f0..9ef3b0262c 100644 --- a/block.c +++ b/block.c @@ -3632,7 +3632,8 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options, Error *local_err = NULL; GLOBAL_STATE_CODE(); - GRAPH_RDLOCK_GUARD_MAINLOOP(); + + bdrv_graph_rdlock_main_loop(); if (bs->backing != NULL) { goto free_exit; @@ -3713,7 +3714,9 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options, /* Hook up the backing file link; drop our reference, bs owns the * backing_hd reference now */ + bdrv_graph_rdunlock_main_loop(); ret = bdrv_set_backing_hd(bs, backing_hd, errp); + bdrv_graph_rdlock_main_loop(); bdrv_unref(backing_hd); if (ret < 0) { @@ -3725,6 +3728,7 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options, free_exit: g_free(backing_filename); qobject_unref(tmp_parent_options); + bdrv_graph_rdunlock_main_loop(); return ret; }