From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxfxE-0001dh-Ih for qemu-devel@nongnu.org; Fri, 21 Oct 2016 15:58:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxfxD-0005lT-Ru for qemu-devel@nongnu.org; Fri, 21 Oct 2016 15:58:12 -0400 References: <1475232808-4852-1-git-send-email-vsementsov@virtuozzo.com> <1475232808-4852-13-git-send-email-vsementsov@virtuozzo.com> From: Max Reitz Message-ID: <0cb068bb-e625-ecb3-0078-b20828920619@redhat.com> Date: Fri, 21 Oct 2016 21:58:04 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MFDc4oP4X51WjtvtSWG5OVPNra0eK1Wxm" Subject: Re: [Qemu-devel] [PATCH 12/22] qcow2-bitmap: add IN_USE flag List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladimir Sementsov-Ogievskiy , 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 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MFDc4oP4X51WjtvtSWG5OVPNra0eK1Wxm From: Max Reitz To: Vladimir Sementsov-Ogievskiy , 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 Message-ID: <0cb068bb-e625-ecb3-0078-b20828920619@redhat.com> Subject: Re: [PATCH 12/22] qcow2-bitmap: add IN_USE flag References: <1475232808-4852-1-git-send-email-vsementsov@virtuozzo.com> <1475232808-4852-13-git-send-email-vsementsov@virtuozzo.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 21.10.2016 17:34, Vladimir Sementsov-Ogievskiy wrote: > 07.10.2016 22:44, Max Reitz =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >> On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote: >>> This flag means that the bitmap is now in use by the software or was = not >>> successfully saved. In any way, with this flag set the bitmap data mu= st >>> be considered inconsistent and should not be loaded. >>> >>> With current implementation this flag is never set, as we just remove= >>> bitmaps from the image after loading. But it defined in qcow2 spec an= d >>> must be handled. Also, it can be used in future, if async schemes of >>> bitmap loading/saving are implemented. >>> >>> We also remove in-use bitmaps from the image on open. >>> >>> Signed-off-by: Vladimir Sementsov-Ogievskiy >>> --- >>> block/qcow2-bitmap.c | 17 ++++++++++++++++- >>> 1 file changed, 16 insertions(+), 1 deletion(-) >> Don't you want to make use of this flag? It would appear useful to me = if >> you just marked autoload bitmaps as in_use instead of deleting them fr= om >> the image when it's opened and then overwrite them when the image is >> closed. >=20 > And what is the use of it? You don't need to free any bitmaps when opening the file, and you don't need to allocate any new bitmap space when closing it. > Any way, storing an invalid copy of online data is bad I think. > Therefore I will have to free bitmap data clusters and zero bitmap tabl= e > in file. Why can't you just set this flag to mark it invalid? In case qemu crashes, in one case you'll have some invalid bitmaps and in the other you won't have any of them at all. I don't think there's a difference from that perspective. Max --MFDc4oP4X51WjtvtSWG5OVPNra0eK1Wxm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEvBAEBCAAZBQJYCnNMEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRD0B9sAYdXPQGo0 B/9Nm/9XrJym1gwQbT14OQuZ7zeNQKR/ukjCkfVtZP8rIMe4z6GG5Y0SPRilLTyY lRaRQCPlXhYA9PWQKpMWJOBKkVPw+oeYQhTvTx9O1KSg4LYeOMAh6mcRLsinSJrH ItwJAZQ2+T4Jc1bsurlJ1EKZByAslZR5uVpkIatVx7PX2/Pjvba77U0uwckft0Sj 7AobcLuuYQuvjs9e1skiwhwg0m16DVPhnprccCSBJmzIixvAHb5BLVfImP4EcAZZ wxg7dYG5k76cwh11++INfQZ7QKS7e81ZceL+gPMqvdb7GhEiAfpymImK1l9ZI4go 2+Yvbgia2OL2HbCXpSnu9Tt6 =BUbf -----END PGP SIGNATURE----- --MFDc4oP4X51WjtvtSWG5OVPNra0eK1Wxm--