On 09.06.2016 10:20, Alberto Garcia wrote: > 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 <be...@igalia.com> > --- > blockjob.c | 13 +++++++++++++ > include/block/blockjob.h | 10 ++++++++++ > 2 files changed, 23 insertions(+)
Reviewed-by: Max Reitz <mre...@redhat.com> Just to throw out a suggestion, I'm not sure how useful it will be after the rest of the series: Would it make sense to prevent name clashes between block job IDs and device IDs (i.e. BlockBackend names)? If we did that, this function could be used to identify a block job both based on its name and its device. Just a suggestion, though, I don't think it will be necessary. Legacy applications will always create jobs with auto-generated IDs that cannot clash with BB names anyway. If we require applications that do name their block jobs manually to always use this ID when specifying a block job, everything will be fine even if block job and BB names do clash. Max
signature.asc
Description: OpenPGP digital signature