[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 04/11] block: Use block_job_get() in find_blo
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-devel] [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
- [Qemu-devel] [PATCH v3 00/11] Allow creating block jobs with a user-defined ID, Alberto Garcia, 2016/07/01
- [Qemu-devel] [PATCH v3 09/11] commit: Add 'job-id' parameter to 'block-commit', Alberto Garcia, 2016/07/01
- [Qemu-devel] [PATCH v3 05/11] blockjob: Add 'job_id' parameter to block_job_create(), Alberto Garcia, 2016/07/01
- [Qemu-devel] [PATCH v3 01/11] stream: Fix prototype of stream_start(), Alberto Garcia, 2016/07/01
- [Qemu-devel] [PATCH v3 06/11] mirror: Add 'job-id' parameter to 'blockdev-mirror' and 'drive-mirror', Alberto Garcia, 2016/07/01
- [Qemu-devel] [PATCH v3 11/11] blockjob: Update description of the 'device' field in the QMP API, Alberto Garcia, 2016/07/01
- [Qemu-devel] [PATCH v3 07/11] backup: Add 'job-id' parameter to 'blockdev-backup' and 'drive-backup', Alberto Garcia, 2016/07/01
- [Qemu-devel] [PATCH v3 03/11] blockjob: Add block_job_get(), Alberto Garcia, 2016/07/01