qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] iscsi: Remove pointless runtime check of macro value
Date: Wed, 13 May 2015 10:43:25 +0200	[thread overview]
Message-ID: <55530EAD.5070104@redhat.com> (raw)
In-Reply-To: <1431522928-5292-1-git-send-email-famz@redhat.com>



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 <famz@redhat.com>
> ---
>  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	other threads:[~2015-05-13  8:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13 13:15 [Qemu-devel] [PATCH] iscsi: Remove pointless runtime check of macro value Fam Zheng
2015-05-13  8:43 ` Paolo Bonzini [this message]
2015-05-13  8:52   ` Fam Zheng
2015-05-28 11:17 ` Michael Tokarev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55530EAD.5070104@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=famz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).