[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 for-2.10 3/4] block: Add errp to BD.bdrv_trun
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH v2 for-2.10 3/4] block: Add errp to BD.bdrv_truncate() |
Date: |
Tue, 28 Mar 2017 21:36:28 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 23.03.2017 19:00, Kevin Wolf wrote:
> Am 08.03.2017 um 20:15 hat Max Reitz geschrieben:
>> Add an Error parameter to the block drivers' bdrv_truncate() interface.
>> If a block driver does not set this in case of an error, the generic
>> bdrv_truncate() implementation will do so.
>>
>> Where it is obvious, this patch also makes some block drivers set this
>> value.
>>
>> Signed-off-by: Max Reitz <address@hidden>
>
>> diff --git a/block/iscsi.c b/block/iscsi.c
>> index 75d890538e..ab559a6f71 100644
>> --- a/block/iscsi.c
>> +++ b/block/iscsi.c
>> @@ -2060,7 +2060,7 @@ static void iscsi_reopen_commit(BDRVReopenState
>> *reopen_state)
>> }
>> }
>>
>> -static int iscsi_truncate(BlockDriverState *bs, int64_t offset)
>> +static int iscsi_truncate(BlockDriverState *bs, int64_t offset, Error
>> **errp)
>> {
>> IscsiLun *iscsilun = bs->opaque;
>> Error *local_err = NULL;
>> @@ -2071,7 +2071,7 @@ static int iscsi_truncate(BlockDriverState *bs,
>> int64_t offset)
>>
>> iscsi_readcapacity_sync(iscsilun, &local_err);
>> if (local_err != NULL) {
>> - error_free(local_err);
>> + error_propagate(errp, local_err);
>> return -EIO;
>> }
>
> I think this function contains a few more cases for patch 4.
I'm probably going to follow Stefan's proposal of adding (even generic)
error messages to all drivers anyway.
Max
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH v2 for-2.10 0/4] block: Add errp to b{lk, drv}_truncate(), Max Reitz, 2017/03/08
- [Qemu-block] [PATCH v2 for-2.10 1/4] block/vhdx: Make vhdx_create() always set errp, Max Reitz, 2017/03/08
- [Qemu-block] [PATCH v2 for-2.10 2/4] block: Add errp to b{lk, drv}_truncate(), Max Reitz, 2017/03/08
- [Qemu-block] [PATCH v2 for-2.10 3/4] block: Add errp to BD.bdrv_truncate(), Max Reitz, 2017/03/08
- [Qemu-block] [PATCH v2 for-2.10 4/4] block: Add some bdrv_truncate() error messages, Max Reitz, 2017/03/08
- Re: [Qemu-block] [PATCH v2 for-2.10 0/4] block: Add errp to b{lk, drv}_truncate(), Kevin Wolf, 2017/03/23