qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: Ian Molton <ian.molton@collabora.co.uk>
Subject: Re: [Qemu-devel] OPT_SIZE parsing
Date: Tue, 17 Nov 2009 13:24:14 +0000	[thread overview]
Message-ID: <200911171324.15230.paul@codesourcery.com> (raw)
In-Reply-To: <4B029916.6000809@collabora.co.uk>

On Tuesday 17 November 2009, Ian Molton wrote:
> Hi,
> 
> Qemu currently is making a bit of a hash of parsing suffixes,
> 
> Right now, it has:
> 
> T, G, M, and K  which are multiples of 1024 bytes - fair enough
> 
> but it also has:
> 
> k - 1024  (should be 1000)
> 
> and b:
> 
> Byte (also wrong)
> 
> since its only using a single character, with b taken, theres no way to
> represent 'bit' unless I use B, which is a bit, well daft.
> 
> Would there be any issues if this was updated to parse
> [T,t,G,g,M,m,K,k,][,B,b] type syntax, so we could have things like Kb
> and MB for Kbits and Megabytes respectively ?

When do we ever have a value that can be specified as both bits and bytes? I 
don't think it makes sense to specify this. The fact that we accept a "b" 
suffix at all is suspicious.
For the magnitude IMO only sane thing to do is ignore the case, and decide 
whether we're using binary or decimal multipliers. Remember that if you're 
being pedantic then "m" should be 0.001.

Paul

  reply	other threads:[~2009-11-17 13:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-17 12:37 [Qemu-devel] OPT_SIZE parsing Ian Molton
2009-11-17 13:24 ` Paul Brook [this message]
2009-11-17 14:23   ` Ian Molton
2009-11-17 16:51     ` Gerd Hoffmann
2009-11-17 18:11       ` Ian Molton
2009-11-17 19:19         ` Gerd Hoffmann

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=200911171324.15230.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=ian.molton@collabora.co.uk \
    --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).