From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2LmH-0002eb-7t for qemu-devel@nongnu.org; Tue, 09 Jun 2015 11:49:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2LmE-00010m-0n for qemu-devel@nongnu.org; Tue, 09 Jun 2015 11:49:25 -0400 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:37790) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2LmD-0000zk-QM for qemu-devel@nongnu.org; Tue, 09 Jun 2015 11:49:21 -0400 Received: by wifx6 with SMTP id x6so21705617wif.0 for ; Tue, 09 Jun 2015 08:49:21 -0700 (PDT) Date: Tue, 9 Jun 2015 16:49:18 +0100 From: Stefan Hajnoczi Message-ID: <20150609154918.GE3181@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="7LkOrbQMr4cezO2T" 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 --7LkOrbQMr4cezO2T 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: > @@ -928,8 +936,9 @@ static int qcow2_open(BlockDriverState *bs, QDict *op= tions, int flags, > } > =20 > /* Clear unknown autoclear feature bits */ > - if (!bs->read_only && !(flags & BDRV_O_INCOMING) && s->autoclear_fea= tures) { > - s->autoclear_features =3D 0; > + if (!bs->read_only && !(flags & BDRV_O_INCOMING) && > + (s->autoclear_features & ~QCOW2_AUTOCLEAR_MASK)) { > + s->autoclear_features |=3D QCOW2_AUTOCLEAR_MASK; This should be bitwise-and instead of bitwise-or: s->autoclear_features &=3D QCOW2_AUTOCLEAR_MASK Otherwise we set features that happen to be in QCOW2_AUTOCLEAR_MASK but were not enabled by the user. Right now that's not fatal but if other features are added to QCOW2_AUTOCLEAR_MASK it could introduce a bug, depending on the feature semantics. --7LkOrbQMr4cezO2T Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVdwr+AAoJEJykq7OBq3PIA2IH/0BSbw78mo4/K1MviL4YLhfY mB1FmPauGYTnEBVujc3o3jZ4j9u4Mb00/ICQI+c7h+5+VNhBtDdPfMtz7T+4mUc6 Vbq5mQ/vC7dox+yRwebHXj58rxrvBfGcyVhMrKUBF/V61RWf5EPUCdlSh56KB/Am MlIYkqzIctLITQHWZAESlqyH0hUGVtrOZpQRAS6Qg1lvpz05eiUBre4FTsf5GNr5 1pWRUVPRyqj1i3YT5WMKhtp0dkY/0sgRhmkxAifZNRc2tJ2jggc+el8J3OQD8jNi is2JfIiZPnsaeqUIhsrfgOye153RsT1YIXsYOEJJEMaLpD6mjN3xffTYRGgjzaI= =IWmu -----END PGP SIGNATURE----- --7LkOrbQMr4cezO2T--