qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 02/12] block: add flags to bdrv_*_write_zeroes


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 02/12] block: add flags to bdrv_*_write_zeroes
Date: Fri, 13 Sep 2013 10:58:17 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8

On 09/13/2013 04:24 AM, Peter Lieven wrote:
> Signed-off-by: Peter Lieven <address@hidden>
> ---
>  block-migration.c         |    2 +-
>  block.c                   |   20 +++++++++++---------
>  block/backup.c            |    3 ++-
>  block/qcow2.c             |    2 +-
>  block/qed.c               |    3 ++-
>  block/raw_bsd.c           |    5 +++--
>  block/vmdk.c              |    3 ++-
>  include/block/block.h     |    4 ++--
>  include/block/block_int.h |    2 +-
>  qemu-io-cmds.c            |    2 +-
>  10 files changed, 26 insertions(+), 20 deletions(-)

Reviewed-by: Eric Blake <address@hidden>

>  
> -int bdrv_write_zeroes(BlockDriverState *bs, int64_t sector_num, int 
> nb_sectors)
> +int bdrv_write_zeroes(BlockDriverState *bs, int64_t sector_num,
> +                      int nb_sectors, BdrvRequestFlags flags)

Technically, you are allowing any bitwise combination of
BdrvRequestFlags, including combinations that are NOT enumerated values
within BdrvRequestFlags.  There are some type-strict languages where
you'd fail to compile when passing in a non-enum value.  But C allows
this (ab)use of enum types in place of an integer type, and I find it
better documented this way, so I'm fine with leaving it as-is.  That,
and you're just copying existing style already in qemu :)

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

[Prev in Thread] Current Thread [Next in Thread]