History | View | Annotate | Download (7.8 kB)
qapi.py: Maintain a list of union types
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>
qapi: Anonymous unions
The discriminator for anonymous unions is the data type. This allows tohave a union type that allows both of these:
{ 'file': 'my_existing_block_device_id' } { 'file': { 'filename': '/tmp/mydisk.qcow2', 'read-only': true } }...
qapi.py: Avoid code duplication
The code that interprets the read JSON expression and appends types tothe respective global variables was duplicated. We can avoid that bysplitting off the part that reads from the file.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
qapi.py: Allow top-level type reference for command definitions
If 'data' for a command definition isn't a dict, but a string, it istaken as a (struct) type name and the fields of this struct are directlyused as parameters.
This is useful for transactionable commands that can use the same type...
qapi: qapi-types.py, native list support
Teach type generators about native types so they can generate theappropriate linked list types.
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Amos Kong <akong@redhat.com>...
qapi: do not protect enum values from namespace pollution
Enum values are always preceded by the uppercase name of the enum, sothey do not conflict with reserved words.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi: add "unix" to the set of reserved words
It is #defined to 1.
qapi: avoid reserved keywords
Clang compiler complained about use of reserved word 'restrict' in SLIRPand QAPI.
Prefix C keywords with "q_", adjust SLIRP accordingly.
Reviewed-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qapi: qapi.py: allow the "'" character to be escaped
Support escaping the escape character, and make more robust (don't diefor '', handle ' without matching '.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
qapi: generate C types for fixed-width integers
(Long line folded using parens:<http://www.python.org/dev/peps/pep-0008/#maximum-line-length>.)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qapi: introduce "size" type
v1->v2:- fall back to uint64 rather than int
qapi: add c_fun to escape function names
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qapi: fix guardname generation
Fix a bug in handling dotted paths, and exclude directory prefixesfrom generated guardnames to avoid odd/pseudo-random guardnames ingenerated headers.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qapi: add code generation support for middle mode
To get the ball rolling merging QAPI, this patch introduces a "middle mode" tothe code generator. In middle mode, the code generator generates marshallingfunctions that are compatible with the current QMP server. We absolutely need...
qapi: add qapi.py helper libraries
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>