On Sat 02 Jul 2016 04:02:11 PM CEST, Max Reitz wrote:
>> +/* Get a block job using its ID and acquire its AioContext */
>> +static BlockJob *find_block_job(const char *id, AioContext **aio_context,
>> Error **errp)
>> {
>> - BlockBackend *blk;
>> - BlockDriverState *bs;
>> + BlockJob *job;
>>
>> *aio_context = NULL;
>>
>> - blk = blk_by_name(device);
>> - if (!blk) {
>> - goto notfound;
>> + if (!id) {
>> + error_setg(errp, "Unspecified job ID when looking for a block job");
>> + return NULL;
>> }
>
> Why no plain assertion? Do you expect callers who may pass a NULL ID?
I think you're right, I'll use an assertion instead. I assume I can keep
your R-b if I just change that ?
Berto