]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
OptsVisitor: introduce list modes for interval flattening
authorLaszlo Ersek <lersek@redhat.com>
Mon, 19 Aug 2013 22:35:34 +0000 (00:35 +0200)
committerLuiz Capitulino <lcapitulino@redhat.com>
Tue, 20 Aug 2013 15:51:59 +0000 (11:51 -0400)
commitd8754f40acb2d30e4735cdcd21a16e7ac29264a3
treefdac09250ca1d34a793b28b6bd09efedfc1f6cf2
parentd95704341280fc521dc2b16bbbc5858f6647e2c3
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:
- opts_next_list() is valid to call while flattening a range,
- opts_end_list(): ditto,
- lookup_scalar() is invalid to call during flattening; generated qapi
  traversal code must continue asking for the same kind of signed/unsigned
  list element until the interval is fully flattened,
- processed(): ditto.

List mode restrictions are always formulated in positive / inclusive
sense. The restrictions for lookup_scalar() and processed() are
automatically satisfied by current qapi traversals if the schema to build
is compatible with OptsVisitor.

The new list modes are not entered yet.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi/opts-visitor.c