[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH 03/15] blockjob: Add block_job_get()

From: Alberto Garcia
Subject: Re: [Qemu-block] [PATCH 03/15] blockjob: Add block_job_get()
Date: Tue, 21 Jun 2016 14:09:51 +0200
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Mon 20 Jun 2016 06:24:30 PM CEST, Max Reitz 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 <address@hidden>
>> ---
>>  blockjob.c               | 13 +++++++++++++
>>  include/block/blockjob.h | 10 ++++++++++
>>  2 files changed, 23 insertions(+)
> Reviewed-by: Max Reitz <address@hidden>
> 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.

I considered that. Apart from the reasons that have been mentioned,
there's also the problem that the user doesn't have control over the
device name when creating jobs, so for example you could not start a new
job on a device with the same name as an existing job, or two jobs on
the same device.

These two cases are a bit far-fetched (the latter is anyway not
supported yet), but they hinted me that it's better to make the use of
the job ID explicit and leave the device name for older clients.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]