Re: [Qemu-devel] OPT_SIZE parsing

2009-11-17 Thread Gerd Hoffmann
On 11/17/09 19:11, Ian Molton wrote: Gerd Hoffmann wrote: Maybe also create a common function for parsing called by both parse_size() and parse_option_size() to make sure OPT_SIZE and the new size property accept the same syntax? The thought crossed my mind, but then I thought that as none of

Re: [Qemu-devel] OPT_SIZE parsing

2009-11-17 Thread Ian Molton
Gerd Hoffmann wrote: > On 11/17/09 15:23, Ian Molton wrote: >> I've cooked up this patch (attached) to add a SIZE property to qdevs. >> I've kept the same semantics as the OPT_SIZE parser for now. > > The error message should be adapted (s/Option/Property/ at least). Fixed locally. > Maybe also

Re: [Qemu-devel] OPT_SIZE parsing

2009-11-17 Thread Gerd Hoffmann
On 11/17/09 15:23, Ian Molton wrote: I've cooked up this patch (attached) to add a SIZE property to qdevs. I've kept the same semantics as the OPT_SIZE parser for now. The error message should be adapted (s/Option/Property/ at least). Maybe also create a common function for parsing called by b

Re: [Qemu-devel] OPT_SIZE parsing

2009-11-17 Thread Ian Molton
Paul Brook wrote: > On Tuesday 17 November 2009, Ian Molton wrote: > 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. Well, entropy is often measured in 'bits'

Re: [Qemu-devel] OPT_SIZE parsing

2009-11-17 Thread Paul Brook
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 wron

[Qemu-devel] OPT_SIZE parsing

2009-11-17 Thread Ian Molton
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 r