From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bujBT-0007WA-Gd for qemu-devel@nongnu.org; Thu, 13 Oct 2016 12:48:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bujBR-0001Vj-Iw for qemu-devel@nongnu.org; Thu, 13 Oct 2016 12:48:42 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:10782 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bujBR-0001Us-7b for qemu-devel@nongnu.org; Thu, 13 Oct 2016 12:48:41 -0400 References: <1475232808-4852-1-git-send-email-vsementsov@virtuozzo.com> <1475232808-4852-12-git-send-email-vsementsov@virtuozzo.com> <8092a3b9-1290-5566-f29e-8f894559f927@redhat.com> From: Vladimir Sementsov-Ogievskiy Message-ID: <57FFBAD9.5080202@virtuozzo.com> Date: Thu, 13 Oct 2016 19:48:25 +0300 MIME-Version: 1.0 In-Reply-To: <8092a3b9-1290-5566-f29e-8f894559f927@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 11/22] qcow2-bitmap: add qcow2_store_persistent_bitmaps() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: kwolf@redhat.com, armbru@redhat.com, eblake@redhat.com, jsnow@redhat.com, famz@redhat.com, den@openvz.org, stefanha@redhat.com, pbonzini@redhat.com 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? -- Best regards, Vladimir