[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 11/22] qcow2-bitmap: add qcow2_store_persistent_
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH 11/22] qcow2-bitmap: add qcow2_store_persistent_bitmaps() |
Date: |
Sat, 15 Oct 2016 18:40:13 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
On 13.10.2016 18:48, 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
>
> [snip]
>
>>> + uint64_t end = MIN(bm_size, sector + dsc);
>>> + uint64_t write_size =
>>> + bdrv_dirty_bitmap_serialization_size(bitmap, sector, end
>>> - sector);
>>> +
>>> + int64_t off = qcow2_alloc_clusters(bs, cl_size);
>>> + if (off < 0) {
>>> + ret = off;
>>> + goto finish;
>>> + }
>>> + bitmap_table[cluster] = off;
>>> +
>>> + bdrv_dirty_bitmap_serialize_part(bitmap, buf, sector, end);
>> s/end/end - sector/?
>
> o_0 terrible mistake, thank you.
>
>>
>>> + if (write_size < cl_size) {
>>> + memset(buf + write_size, 0, cl_size - write_size);
>>> + }
>>> +
>> I guess there should be a metadata overlap check here.
>
> What is the general rule of checking it? Should I check it before all my
> extension related writes?
The general rule is supposed to be "One check before every write to
bs->file".
Max
signature.asc
Description: OpenPGP digital signature