qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [PATCH] iscsi: Remove pointless runtime check of macr


From: Paolo Bonzini
Subject: Re: [Qemu-trivial] [PATCH] iscsi: Remove pointless runtime check of macro value
Date: Wed, 13 May 2015 10:43:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0


On 13/05/2015 15:15, Fam Zheng wrote:
> raw_bsd already has QEMU_BUILD_BUG_ON(BDRV_SECTOR_SIZE != 512), so iscsi
> should relax.

It's okay to have the same QEMU_BUILD_BUG_ON in different places.
However, you're right that this should be a compile-time check rather
than run-time check.

Paolo

> Signed-off-by: Fam Zheng <address@hidden>
> ---
>  block/iscsi.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/block/iscsi.c b/block/iscsi.c
> index 8fca1d3..14e97a6 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -1323,13 +1323,6 @@ static int iscsi_open(BlockDriverState *bs, QDict 
> *options, int flags,
>      const char *filename;
>      int i, ret = 0;
>  
> -    if ((BDRV_SECTOR_SIZE % 512) != 0) {
> -        error_setg(errp, "iSCSI: Invalid BDRV_SECTOR_SIZE. "
> -                   "BDRV_SECTOR_SIZE(%lld) is not a multiple "
> -                   "of 512", BDRV_SECTOR_SIZE);
> -        return -EINVAL;
> -    }
> -
>      opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
>      qemu_opts_absorb_qdict(opts, options, &local_err);
>      if (local_err) {
> 



reply via email to

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