From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2LnC-0003j4-Dc for qemu-devel@nongnu.org; Tue, 09 Jun 2015 11:50:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2Ln9-0002Yr-4M for qemu-devel@nongnu.org; Tue, 09 Jun 2015 11:50:22 -0400 Received: from mail-wg0-x22f.google.com ([2a00:1450:400c:c00::22f]:35110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2Ln8-0002YB-TA for qemu-devel@nongnu.org; Tue, 09 Jun 2015 11:50:19 -0400 Received: by wgme6 with SMTP id e6so17007412wgm.2 for ; Tue, 09 Jun 2015 08:50:18 -0700 (PDT) Date: Tue, 9 Jun 2015 16:50:15 +0100 From: Stefan Hajnoczi Message-ID: <20150609155014.GF3181@stefanha-thinkpad.redhat.com> References: <1433776886-27239-1-git-send-email-vsementsov@virtuozzo.com> <1433776886-27239-7-git-send-email-vsementsov@virtuozzo.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+jhVVhN62yS6hEJ8" Content-Disposition: inline In-Reply-To: <1433776886-27239-7-git-send-email-vsementsov@virtuozzo.com> 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: Vladimir Sementsov-Ogievskiy Cc: kwolf@redhat.com, qemu-devel@nongnu.org, Vladimir Sementsov-Ogievskiy , stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, jsnow@redhat.com --+jhVVhN62yS6hEJ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 08, 2015 at 06:21:24PM +0300, Vladimir Sementsov-Ogievskiy wrot= e: > 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 *b= s, uint64_t start_offset, > return ret; > } > =20 > + if (!(s->autoclear_features & QCOW2_AUTOCLEAR_DIRTY_BITMAPS)= && > + s->nb_dirty_bitmaps > 0) { > + ret =3D 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(). --+jhVVhN62yS6hEJ8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVdws2AAoJEJykq7OBq3PIk8cH+wVr+CTw0mY4c85WXRP7PI7v MXWb2zzuVasIsCECHtOfwcc6rpN5EYJ3cOx0iaT45MOBtqJh3SrQKW0r6PTGHLDh xQX9kcx/kJsNWV96e0CjyC2Ew5Qo4dSR7UKlqzsgZFmgwsjWjosOb+I9uyxVoyaN vDRhkMBWA0jEnfQeypSqB7gdPqFAYGuuuDNNa3I21mHe/NSCsTtCGQUFrXggFUG5 xgIGskD3E/RJDz3oysx/kr2s7vdDvgsywJ+ZYvEdloySynC9hXu3F8oPn87n8DQi XYGwFTgKJD3bN0shoEAbgPjUZkttbB+MHbBZK1uQ6WbdzJ7RMEBMIYU1FSP0wsA= =+iQD -----END PGP SIGNATURE----- --+jhVVhN62yS6hEJ8--