[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] OPT_SIZE parsing
From: |
Paul Brook |
Subject: |
Re: [Qemu-devel] OPT_SIZE parsing |
Date: |
Tue, 17 Nov 2009 13:24:14 +0000 |
User-agent: |
KMail/1.12.2 (Linux/2.6.30-2-amd64; KDE/4.3.2; x86_64; ; ) |
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