Statistics
| Branch: | Revision:

root / qapi @ 8cfd0495

Latest revisions

# Date Author Comment
15a849be 08/20/2013 06:52 pm Laszlo Ersek

OptsVisitor: don't try to flatten overlong integer ranges

Prevent mistyped command line options from incurring high memory and CPU
usage at startup. 64K elements in a range should be enough for everyone
(TM).

The OPTS_VISITOR_RANGE_MAX macro is public so that unit tests can...

d9570434 08/20/2013 06:51 pm Laszlo Ersek

OptsVisitor: introduce basic list modes

We're going to need more state while processing a list of repeated
options. This change eliminates "repeated_opts_first" and adds a new state
variable:

list_mode       repeated_opts  repeated_opts_first
-------------- ------------- -------------------...
d8754f40 08/20/2013 06:51 pm Laszlo Ersek

OptsVisitor: introduce list modes for interval flattening

The new modes are equal-rank, exclusive alternatives of LM_IN_PROGRESS.
Teach opts_next_list(), opts_type_int() and opts_type_uint64() to handle
them.

Also enumerate explicitly what functions are valid to call in what modes:...

1e1c555a 08/20/2013 06:51 pm Laszlo Ersek

OptsVisitor: opts_type_int(): recognize intervals when LM_IN_PROGRESS

When a well-formed range value, bounded by signed integers, is encountered
while processing a repeated option, enter LM_SIGNED_INTERVAL and return
the low bound.

Signed-off-by: Laszlo Ersek <>...

62d090e2 08/20/2013 06:51 pm Laszlo Ersek

OptsVisitor: rebase opts_type_uint64() to parse_uint_full()

Simplify the code in preparation for the next patch.

Signed-off-by: Laszlo Ersek <>
Tested-by: Wanlong Gao <>
Signed-off-by: Luiz Capitulino <>

581a8a80 08/20/2013 06:51 pm Laszlo Ersek

OptsVisitor: opts_type_uint64(): recognize intervals when LM_IN_PROGRESS

When a well-formed range value, bounded by unsigned integers, is
encountered while processing a repeated option, enter LM_UNSIGNED_INTERVAL
and return the low bound.

Signed-off-by: Laszlo Ersek <>...

b8877962 07/30/2013 03:33 am Vasilis Liaskovitis

qapi: make visit_type_size fallback to type_int

Currently visit_type_size checks if the visitor's type_size function pointer is
NULL. If not, it calls it, otherwise it calls v->type_uint64(). But neither of
these pointers are ever set. Fallback to calling v->type_int() in this third...

e8316d7e 07/26/2013 10:10 pm Kevin Wolf

qapi: Add consume argument to qmp_input_get_object()

This allows to just look at the next element without actually consuming
it.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>

69dd62df 07/26/2013 10:10 pm Kevin Wolf

qapi: Anonymous unions

The discriminator for anonymous unions is the data type. This allows to
have a union type that allows both of these:

{ 'file': 'my_existing_block_device_id' }
{ 'file': { 'filename': '/tmp/mydisk.qcow2', 'read-only': true } }...
761d524d 07/26/2013 09:17 pm Kevin Wolf

qapi: Add visitor for implicit structs

These can be used when an embedded struct is parsed and members not
belonging to the struct may be present in the input (e.g. parsing a
flat namespace QMP union, where fields from both the base and one
of the alternative types are mixed in the JSON object)...

View revisions

Also available in: Atom