From ffb1f10cd1118393627e1bd2dad0a68152d2e539 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Date: Tue, 5 Jul 2016 17:28:54 +0300 Subject: blockjob: Add block_job_get() Currently the way to look for a specific block job is to iterate the list manually using block_job_next(). Since we want to be able to identify a job primarily by its ID it makes sense to have a function that does just that. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/blockjob.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/block') diff --git a/include/block/blockjob.h b/include/block/blockjob.h index 97b86f109f..934bf1ce2d 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -211,6 +211,16 @@ struct BlockJob { */ BlockJob *block_job_next(BlockJob *job); +/** + * block_job_get: + * @id: The id of the block job. + * + * Get the block job identified by @id (which must not be %NULL). + * + * Returns the requested job, or %NULL if it doesn't exist. + */ +BlockJob *block_job_get(const char *id); + /** * block_job_create: * @job_type: The class object for the newly-created job. -- cgit v1.2.3-55-g7522