From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFRkg-000756-2S for qemu-devel@nongnu.org; Mon, 17 Feb 2014 12:13:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFRkb-0006RT-6Y for qemu-devel@nongnu.org; Mon, 17 Feb 2014 12:13:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFRka-0006RO-Tc for qemu-devel@nongnu.org; Mon, 17 Feb 2014 12:13:01 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1HHCw5D024528 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 17 Feb 2014 12:12:59 -0500 Message-ID: <53024319.10203@redhat.com> Date: Mon, 17 Feb 2014 10:12:57 -0700 From: Eric Blake MIME-Version: 1.0 References: <1392648347-4981-1-git-send-email-kwolf@redhat.com> In-Reply-To: <1392648347-4981-1-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1kaw9Q951wrVuT5OPVsgMwRJs00gILQVG" Subject: Re: [Qemu-devel] [PATCH v2] qcow2: Set zero flag for discarded clusters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel@nongnu.org Cc: stefanha@redhat.com, mreitz@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1kaw9Q951wrVuT5OPVsgMwRJs00gILQVG Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/17/2014 07:45 AM, Kevin Wolf wrote: > Instead of making the backing file contents visible again after a disca= rd > request, set the zero flag if possible (i.e. on version >=3D 3). >=20 > Signed-off-by: Kevin Wolf > --- > block/qcow2-cluster.c | 22 ++++++++++++++++++++-- > tests/qemu-iotests/046 | 18 ++++++++++++++---- > 2 files changed, 34 insertions(+), 6 deletions(-) >=20 > + if (!!(old_offset & QCOW_OFLAG_ZERO)) { The !! is not necessary here; any non-zero value in a boolean context gives the same result as an explicit conversion to 0-or-1. But as that's cosmetic, I'm okay whether you leave it as is or simplify it, when adding: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --1kaw9Q951wrVuT5OPVsgMwRJs00gILQVG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTAkMZAAoJEKeha0olJ0NqZIcIAKfKPs0nMQ5chi+dCU/7eVEq HZQY1GtuUgJ//VTqfc3N5LhTobv8bLpCc3Ap3tSRsVTuJqjdl1sIWCiLGOdTwJ5N m7e55k3Gnvol2jreiGFssVq+nOKlup97vx7g9RBWW0YfZR4fDOIM66a3BicCAuS/ nsFCIzyVwFJktFaZ8iMpAz+RLde0nm11KGFiXRfrnos0Nzq8NSiIu2KUs42iGoXA nm0JOPOZcfdjKBAOtlUTYPKZqx6/VpVGkP9zeTkx6EBdFOA0+90JUOuNkPcyh70F /c+tm2/h+UQ92BHB0Sr5JzTr6x5MNMhpKMa5c5piPXfDll4kjtV4VZgdubywHWE= =dRIs -----END PGP SIGNATURE----- --1kaw9Q951wrVuT5OPVsgMwRJs00gILQVG--