All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: John Snow <jsnow@redhat.com>
Cc: jcody@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qemu-img: add check for zero-length job len
Date: Wed, 4 Nov 2015 12:12:00 +0100	[thread overview]
Message-ID: <20151104111200.GC4026@noname.redhat.com> (raw)
In-Reply-To: <5637F5AE.5020006@redhat.com>

Am 03.11.2015 um 00:45 hat John Snow geschrieben:
> >> diff --git a/qemu-img.c b/qemu-img.c
> >> index 3025776..38b4888 100644
> >> --- a/qemu-img.c
> >> +++ b/qemu-img.c
> >> @@ -656,7 +656,8 @@ static void run_block_job(BlockJob *job, Error **errp)
> >>  
> >>      do {
> >>          aio_poll(aio_context, true);
> >> -        qemu_progress_print((float)job->offset / job->len * 100.f, 0);
> >> +        qemu_progress_print(job->len ?
> >> +                            ((float)job->offset / job->len * 100.f) : 0.00, 0);
> > 
> > Also, note that this promotes to double rather than float; maybe you
> > want to use 0.f instead of 0.00 to keep the ternary as a float?  But it
> > shouldn't make a difference in practice.
> 
> Yes, oops -- but harmless.

Thanks, fixed that up and applied to the block branch.

Kevin

  reply	other threads:[~2015-11-04 11:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-02 23:28 [Qemu-devel] [PATCH] qemu-img: add check for zero-length job len John Snow
2015-11-02 23:43 ` Eric Blake
2015-11-02 23:45   ` John Snow
2015-11-04 11:12     ` Kevin Wolf [this message]
2015-11-03  0:24 ` Jeff Cody

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=20151104111200.GC4026@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=jcody@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@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 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.