[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 1/3] block: Extrace bdrv_parse_detect_zeroes_
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2 1/3] block: Extrace bdrv_parse_detect_zeroes_flags |
Date: |
Mon, 08 Jun 2015 16:53:57 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
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
[Qemu-devel] [PATCH v2 2/3] qapi: Add "detect-zeroes" option to drive-mirror, Fam Zheng, 2015/06/08
[Qemu-devel] [PATCH v2 3/3] iotests: Add test cases for drive-mirror "detect-zeroes" option, Fam Zheng, 2015/06/08