Statistics
| Branch: | Revision:

root / qapi / opts-visitor.c @ feature-archipelago

History | View | Annotate | Download (15 kB)

# Date Author Comment
b7745397 03/03/2014 06:17 pm Markus Armbruster

qapi: Add missing null check to opts_start_struct()

Argument is null when visiting an unboxed struct. I can't see such a
visit in the current code. Fix it anyway.

Signed-off-by: Markus Armbruster <>
Reviewed-by: Eric Blake <>...

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 <>...

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

7b1b5d19 12/19/2012 09:31 am Paolo Bonzini

qapi: move include files to include/qobject/

Signed-off-by: Paolo Bonzini <>

79ee7df8 12/19/2012 09:31 am Paolo Bonzini

qapi: move inclusions of qemu-common.h from headers to .c files

Signed-off-by: Paolo Bonzini <>

4167c42c 12/19/2012 09:31 am Paolo Bonzini

qapi: remove qapi/qapi-types-core.h

The file is only including error.h and qerror.h. Prefer explicit
inclusion of whatever files are needed.
Signed-off-by: Paolo Bonzini <>

e36c8766 08/20/2012 05:05 pm Stefan Weil

qapi: Fix memory leak

valgrind report:

24534 232 bytes in 2 blocks are definitely lost in loss record 1,245 of 1,601
24534 at 0x4824F20: malloc (vg_replace_malloc.c:236)
24534 by 0x293C88: malloc_and_trace (vl.c:2281)
24534 by 0x489AD99: ??? (in /lib/libglib-2.0.so.0.2400.1)...
eb7ee2cb 07/23/2012 01:55 pm Laszlo Ersek

qapi: introduce OptsVisitor

This visitor supports parsing

-option [type=]discriminator[,optarg1=val1][,optarg2=val2][,...]

style QemuOpts objects into "native" C structures. After defining the type
tree in the qapi schema (see below), a root type traversal with this...