From bbc02b90bcba371818dbffec89933072f9406945 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Tue, 28 Feb 2017 12:45:58 +0100 Subject: blockjob: Factor out block_job_remove_all_bdrv() In some cases, we want to remove op blockers on intermediate nodes before the whole block job transaction has completed (because they block restoring the final graph state during completion). Provide a function for this. The whole block job lifecycle is a bit messed up and it's hard to actually do all things in the right order, but I'll leave simplifying this for another day. Signed-off-by: Kevin Wolf Acked-by: Fam Zheng Reviewed-by: Max Reitz --- include/block/blockjob.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/block/blockjob.h b/include/block/blockjob.h index 9d65ef80b8..9e906f7d7e 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -180,6 +180,15 @@ BlockJob *block_job_get(const char *id); int block_job_add_bdrv(BlockJob *job, const char *name, BlockDriverState *bs, uint64_t perm, uint64_t shared_perm, Error **errp); +/** + * block_job_remove_all_bdrv: + * @job: The block job + * + * Remove all BlockDriverStates from the list of nodes that are involved in the + * job. This removes the blockers added with block_job_add_bdrv(). + */ +void block_job_remove_all_bdrv(BlockJob *job); + /** * block_job_set_speed: * @job: The job to set the speed for. -- cgit v1.2.3-55-g7522