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

> 
> Signed-off-by: Fam Zheng <f...@redhat.com>
> ---
>  block.c               | 26 ++++++++++++++++++++++++++
>  blockdev.c            | 14 ++------------
>  include/block/block.h |  3 +++
>  3 files changed, 31 insertions(+), 12 deletions(-)
> 

> +
> +    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.  We haven't yet
committed to the 'unmap' bool, so we still have time to get the API right.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to