On Wed, 06/10 17:11, Fam Zheng wrote: > 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"
s/derive/device/ > 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 >