All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Garzarella <sgarzare@redhat.com>
To: Yi Li <yili@winhong.com>
Cc: kwolf@redhat.com, yilikernel@gmail.com, qemu-devel@nongnu.org,
	qemu-block@nongnu.org, mreitz@redhat.com
Subject: Re: [PATCH v2] qemu-img: Explicit number replaced by a constant
Date: Wed, 19 Aug 2020 10:57:13 +0200	[thread overview]
Message-ID: <20200819085713.mtdgxvkpxvcbufse@steredhat.lan> (raw)
In-Reply-To: <20200819013607.32280-1-yili@winhong.com>

On Wed, Aug 19, 2020 at 09:36:07AM +0800, Yi Li wrote:
> Signed-off-by: Yi Li <yili@winhong.com>
> ---
>  qemu-img.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/qemu-img.c b/qemu-img.c
> index 5308773811..aa2e31c8ae 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -1200,10 +1200,10 @@ static int is_allocated_sectors(const uint8_t *buf, int n, int *pnum,
>          *pnum = 0;
>          return 0;
>      }
> -    is_zero = buffer_is_zero(buf, 512);
> +    is_zero = buffer_is_zero(buf, BDRV_SECTOR_SIZE);
>      for(i = 1; i < n; i++) {
> -        buf += 512;
> -        if (is_zero != buffer_is_zero(buf, 512)) {
> +        buf += BDRV_SECTOR_SIZE;
> +        if (is_zero != buffer_is_zero(buf, BDRV_SECTOR_SIZE)) {
>              break;
>          }
>      }
> @@ -2489,8 +2489,8 @@ static int img_convert(int argc, char **argv)
>              }
>          }
>  
> -        qemu_opt_set_number(opts, BLOCK_OPT_SIZE, s.total_sectors * 512,
> -                            &error_abort);
> +        qemu_opt_set_number(opts, BLOCK_OPT_SIZE,
> +                            s.total_sectors * BDRV_SECTOR_SIZE, &error_abort);
>          ret = add_old_style_options(out_fmt, opts, out_baseimg, NULL);
>          if (ret < 0) {
>              goto out;
> -- 
> 2.25.3
> 
> 
> 

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>



  parent reply	other threads:[~2020-08-19  8:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-17 11:01 [PATCH] qemu-img: Explicit number replaced by a constant Yi Li
2020-08-18  7:19 ` Stefano Garzarella
2020-08-18 11:51   ` Max Reitz
2020-08-19  1:36     ` [PATCH v2] " Yi Li
2020-08-19  8:48       ` Alberto Garcia
2020-08-19  8:57       ` Stefano Garzarella [this message]
2020-09-07  9:08       ` Max Reitz

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=20200819085713.mtdgxvkpxvcbufse@steredhat.lan \
    --to=sgarzare@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=yili@winhong.com \
    --cc=yilikernel@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.