qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v3 04/11] block: Use block_job_get() in find_blo


From: Alberto Garcia
Subject: Re: [Qemu-block] [PATCH v3 04/11] block: Use block_job_get() in find_block_job()
Date: Mon, 04 Jul 2016 15:35:31 +0200
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

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



reply via email to

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