From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWMvR-0002tO-1R for qemu-devel@nongnu.org; Mon, 31 Aug 2015 07:06:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWMvN-000263-1y for qemu-devel@nongnu.org; Mon, 31 Aug 2015 07:06:56 -0400 Received: from relay.parallels.com ([195.214.232.42]:41344) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWMvM-000258-PW for qemu-devel@nongnu.org; Mon, 31 Aug 2015 07:06:52 -0400 Message-ID: <55E43538.6020703@virtuozzo.com> Date: Mon, 31 Aug 2015 14:06:32 +0300 From: Vladimir Sementsov-Ogievskiy MIME-Version: 1.0 References: <1433776886-27239-1-git-send-email-vsementsov@virtuozzo.com> <1433776886-27239-7-git-send-email-vsementsov@virtuozzo.com> <20150609155014.GF3181@stefanha-thinkpad.redhat.com> <55DEC00C.8010100@virtuozzo.com> In-Reply-To: <55DEC00C.8010100@virtuozzo.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/8] qcow2: add autoclear bit for dirty bitmaps List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, qemu-devel@nongnu.org, Vladimir Sementsov-Ogievskiy , stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, jsnow@redhat.com On 27.08.2015 10:45, Vladimir Sementsov-Ogievskiy wrote: > On 09.06.2015 18:50, Stefan Hajnoczi wrote: >> On Mon, Jun 08, 2015 at 06:21:24PM +0300, Vladimir >> Sementsov-Ogievskiy wrote: >>> diff --git a/block/qcow2.c b/block/qcow2.c >>> index 406e55d..f85a55a 100644 >>> --- a/block/qcow2.c >>> +++ b/block/qcow2.c >>> @@ -182,6 +182,14 @@ static int >>> qcow2_read_extensions(BlockDriverState *bs, uint64_t start_offset, >>> return ret; >>> } >>> + if (!(s->autoclear_features & >>> QCOW2_AUTOCLEAR_DIRTY_BITMAPS) && >>> + s->nb_dirty_bitmaps > 0) { >>> + ret = qcow2_delete_all_dirty_bitmaps(bs, errp); >>> + if (ret < 0) { >>> + return ret; >>> + } >>> + } >>> + >> What if the file is read-only? >> >> We shouldn't modify the file in qcow2_read_extensions(). > But where? In qcow2_open? Or nowhere? I think auto clear extensions > should be cleared automatically.. > May be, move clearing to qemu-img, and just warn here? -- Best regards, Vladimir * now, @virtuozzo.com instead of @parallels.com. Sorry for this inconvenience.