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 <f.ebner@proxmox.com> Message-ID: <20250530151125.955508-28-f.ebner@proxmox.com> [kwolf: Removed an extra blank line] Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
47bc2ed6f6
commit
d7573eba14
1 changed files with 5 additions and 1 deletions
6
block.c
6
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue