qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 11/22] qcow2-bitmap: add qcow2_store_persistent_


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH 11/22] qcow2-bitmap: add qcow2_store_persistent_bitmaps()
Date: Fri, 21 Oct 2016 21:44:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

On 17.10.2016 19:19, Vladimir Sementsov-Ogievskiy wrote:
> On 07.10.2016 22:24, Max Reitz wrote:
>> On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote:
>>> Realize block bitmap stroing interface, to allow qcow2 images store
>>> persistent bitmaps.
>>>
>>> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
>>> ---
>>>   block/qcow2-bitmap.c | 241
>>> +++++++++++++++++++++++++++++++++++++++++++++++++++
> 
> [...]
> 
>>>
>>> +        ret = bdrv_pwrite(bs->file, off, buf, cl_size);
>>> +        if (ret < 0) {
>>> +            goto finish;
>>> +        }
>>> +
>>> +        if (end >= bm_size) {
>>> +            break;
>>> +        }
>>> +
>>> +        bdrv_set_dirty_iter(dbi, end);
>>> +    }
>>> +    ret = 0; /* writes */
>> What is that comment supposed to mean?
>>
>>
> 
> Now I think I can drop this assignment, as bdrv_aligned_preadv have
> 'return ret < 0 ? ret : 0;' in the end...  Am I right? Can bdrv_pwrite
> and friends return positive value on success?

I think so, but if they do return positive value they're supposed to be
equal to the number of bytes written. In practice, though, any
non-negative return value is treated the same (as success).

I was just wondering about the comment, though, not about the assignment
itself.

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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