From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1xs7-0001f4-AS for qemu-devel@nongnu.org; Mon, 08 Jun 2015 10:17:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z1xs1-0003fz-Ou for qemu-devel@nongnu.org; Mon, 08 Jun 2015 10:17:51 -0400 Message-ID: <5575A402.3040301@redhat.com> Date: Mon, 08 Jun 2015 08:17:38 -0600 From: Eric Blake MIME-Version: 1.0 References: <1433759662-25139-1-git-send-email-famz@redhat.com> <1433759662-25139-2-git-send-email-famz@redhat.com> In-Reply-To: <1433759662-25139-2-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SU33HDo3SfdV8oJ3gsQtHnHNEmFFoo9Ak" Subject: Re: [Qemu-devel] [PATCH v2 1/3] block: Extrace bdrv_parse_detect_zeroes_flags List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, Jeff Cody , Markus Armbruster , stefanha@redhat.com, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SU33HDo3SfdV8oJ3gsQtHnHNEmFFoo9Ak Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/08/2015 04:34 AM, Fam Zheng wrote: > The logic will be shared with qmp_drive_mirror. s/Extrace/Extract/ in the subject >=20 > Signed-off-by: Fam Zheng > --- > block.c | 26 ++++++++++++++++++++++++++ > blockdev.c | 14 ++------------ > include/block/block.h | 3 +++ > 3 files changed, 31 insertions(+), 12 deletions(-) >=20 > + > + if (detect_zeroes =3D=3D BLOCKDEV_DETECT_ZEROES_OPTIONS_UNMAP && > + !(bdrv_flags & BDRV_O_UNMAP)) { > + error_setg(errp, "setting detect-zeroes to unmap is not allowe= d " > + "without setting discard operation to unmap")= ; > + } I think it might be better to have a tri-state enum, than to have two competing bools where only 3 of the 4 states are valid. We haven't yet committed to the 'unmap' bool, so we still have time to get the API right= =2E --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --SU33HDo3SfdV8oJ3gsQtHnHNEmFFoo9Ak Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVdaQCAAoJEKeha0olJ0NqXtgIAJp2Hot0A6UtVgcsQgt0HmzC 8wsRnMLvuD5Ms6s8pH5tuR8VjubtSlgw7GVWUcZNOTCblmDzCllCh/C77Dky3NLQ MZfJpVGZ5lfrYTkafbJtj5EsD6g/qsj+aUqVUVSJnoHacUo7+02me7/PezfLddFi Edbk7+uND1gcIrAo3wLX7sRfsItDmm56RKqZwP3j4FAZwCgPBfPG6W4VS+QYVBYq 3tdv+oe0k9lGbjKrQnH8N9nUrdW0w2nKSU4+Spas50IOtNg5K9AQhb0d8i6KWVa9 vu4qzL4TltkxSNIVlfawbYqj7DES+7GnW5mCZpQ5RWyZO09L83WyuWSFb1V/pEE= =hTyo -----END PGP SIGNATURE----- --SU33HDo3SfdV8oJ3gsQtHnHNEmFFoo9Ak--