From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2c3J-000563-Iu for qemu-devel@nongnu.org; Wed, 10 Jun 2015 05:12:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2c3I-0005hO-KI for qemu-devel@nongnu.org; Wed, 10 Jun 2015 05:12:05 -0400 Date: Wed, 10 Jun 2015 17:11:56 +0800 From: Fam Zheng Message-ID: <20150610091156.GA11648@ad.nay.redhat.com> References: <1433759662-25139-1-git-send-email-famz@redhat.com> <1433759662-25139-2-git-send-email-famz@redhat.com> <5575A402.3040301@redhat.com> <5575AC85.7020101@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5575AC85.7020101@redhat.com> 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: Paolo Bonzini Cc: Kevin Wolf , qemu-block@nongnu.org, Jeff Cody , qemu-devel@nongnu.org, Markus Armbruster , stefanha@redhat.com On Mon, 06/08 16:53, Paolo Bonzini wrote: > > > On 08/06/2015 16:17, Eric Blake wrote: > >> > + > >> > + if (detect_zeroes == BLOCKDEV_DETECT_ZEROES_OPTIONS_UNMAP && > >> > + !(bdrv_flags & BDRV_O_UNMAP)) { > >> > + error_setg(errp, "setting detect-zeroes to unmap is not allowed " > >> > + "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. > > Note that this is not a bool. We have one bool and one 3-element enum > (off/on/unmap), where only 5 of the 6 states are valid. Also, at least > detect-zeroes would go away if we had some kind of blockdev-mirror > (where the target is added first with blockdev-add), so I think it's > better to leave it separate. Agreed. But by then "drive-mirror derive=... detect-zeroes=unmap unmap=false" will be way too confusing. I say let's save that and just go for blockdev-add :) https://www.mail-archive.com/qemu-devel@nongnu.org/msg301990.html Fam