qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Chen Hanxiao <chen_han_xiao@126.com>
Cc: qemu-devel@nongnu.org, Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH] qga: add mountpoint usage to GuestFilesystemInfo
Date: Wed, 30 May 2018 08:05:34 -0500	[thread overview]
Message-ID: <9335469d-ee0f-e6ac-7570-0b5ccab1ca57@redhat.com> (raw)
In-Reply-To: <5e690898.591a.163afd447ec.Coremail.chen_han_xiao@126.com>

On 05/30/2018 01:55 AM, Chen Hanxiao wrote:

>>> +    usage = u100 / nonroot_total + (u100 % nonroot_total != 0);
>>
>> Why integral instead of floating point?
> 
> I followed the style of df from coreutils.
> As the percentage already multiplied by 100,
> I think it has enough precision.

You're making an arbitrary policy decision.  Give the client a floating 
point, and they can still truncate to print out a 2-digit percentage. 
But give them a percentage, and for a 2T disk image, they are forced to 
guess whether they are 20G high or low on usage, which starts to take a 
non-trivial amount of time to copy that much data.  In other words, I 
think an int is wrong for being too imprecise.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

      reply	other threads:[~2018-05-30 13:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-30  3:01 [Qemu-devel] [PATCH] qga: add mountpoint usage to GuestFilesystemInfo Chen Hanxiao
2018-05-30  3:19 ` Eric Blake
2018-05-30  3:20   ` Eric Blake
2018-05-30  6:55   ` Chen Hanxiao
2018-05-30 13:05     ` Eric Blake [this message]

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=9335469d-ee0f-e6ac-7570-0b5ccab1ca57@redhat.com \
    --to=eblake@redhat.com \
    --cc=chen_han_xiao@126.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --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 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).