mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
block: drop wrapper for bdrv_set_backing_hd_drained()
Nearly all callers (outside of the tests) are already using the _drained() variant of the function. It doesn't seem worth keeping. Simply adapt the remaining callers of bdrv_set_backing_hd() and rename bdrv_set_backing_hd_drained() to bdrv_set_backing_hd(). Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> Message-ID: <20250530151125.955508-31-f.ebner@proxmox.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
+8
-5
@@ -1587,12 +1587,12 @@ static void external_snapshot_abort(void *opaque)
|
||||
/*
|
||||
* Note that state->old_bs would not disappear during the
|
||||
* write-locked section, because the unref from
|
||||
* bdrv_set_backing_hd_drained() only happens at the end of the
|
||||
* write-locked section. However, just be explicit about keeping a
|
||||
* reference and don't rely on that implicit detail.
|
||||
* bdrv_set_backing_hd() only happens at the end of the write-locked
|
||||
* section. However, just be explicit about keeping a reference and
|
||||
* don't rely on that implicit detail.
|
||||
*/
|
||||
bdrv_ref(state->old_bs);
|
||||
bdrv_set_backing_hd_drained(state->new_bs, NULL, &error_abort);
|
||||
bdrv_set_backing_hd(state->new_bs, NULL, &error_abort);
|
||||
|
||||
/*
|
||||
* The call to bdrv_set_backing_hd() above returns state->old_bs to
|
||||
@@ -1776,7 +1776,10 @@ static void drive_backup_action(DriveBackup *backup,
|
||||
}
|
||||
|
||||
if (set_backing_hd) {
|
||||
if (bdrv_set_backing_hd(target_bs, source, errp) < 0) {
|
||||
bdrv_graph_wrlock_drained();
|
||||
ret = bdrv_set_backing_hd(target_bs, source, errp);
|
||||
bdrv_graph_wrunlock();
|
||||
if (ret < 0) {
|
||||
goto unref;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user