qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 for-2.10 2/4] block: Add errp to b{lk, drv}_t


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v2 for-2.10 2/4] block: Add errp to b{lk, drv}_truncate()
Date: Tue, 28 Mar 2017 21:34:51 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 23.03.2017 18:46, Kevin Wolf wrote:
> Am 08.03.2017 um 20:14 hat Max Reitz geschrieben:
>> For one thing, this allows us to drop the error message generation from
>> qemu-img.c and blockdev.c and instead have it unified in
>> bdrv_truncate().
>>
>> Signed-off-by: Max Reitz <address@hidden>
> 
>> diff --git a/block/qcow2.c b/block/qcow2.c
>> index 6a92d2ef3f..43b8a986f0 100644
>> --- a/block/qcow2.c
>> +++ b/block/qcow2.c
>> @@ -2294,9 +2294,8 @@ static int qcow2_create2(const char *filename, int64_t 
>> total_size,
>>      }
>>  
>>      /* Okay, now that we have a valid image, let's give it the right size */
>> -    ret = blk_truncate(blk, total_size);
>> +    ret = blk_truncate(blk, total_size, errp);
>>      if (ret < 0) {
>> -        error_setg_errno(errp, -ret, "Could not resize image");
> 
> Maybe error_prepend(errp, "Could not resize image: ") could make sense?

Sure, why not.

Max

>>          goto out;
>>      }
> 
> Kevin
> 


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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