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. Paolo