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 the
other parsers share common code (yet), it didn't make sense.
Well, when the parser is basically a simple strtoull() call it doesn't
make sense. For the size and the postfix processing it makes sense
IMHO, they easily get out of sync otherwise. For a 'bool' property (if
qdev gets one some day) it would make sense too I think.
I can cook up another patch that allows the option parser to hook into
the property parsing functions, or vice-versa, if you like?
Given that qemu-option.c is also used by the tools (qemu-img, ...) it
will be much easier to have qdev use a option parser function than the
other way around.
Otherwise it looks fine to me.
Cool - whats the submission procedure? I can make a git branch publicly
available or I can send patches to someone...
Just send it to the list, one of the maintainers with commit access
(most likely anthony) should pick it up. If it doesn't work try
resending after 2-3 weeks.
cheers,
Gerd