History | View | Annotate | Download (10.5 kB)
qapi: Fix licensing of scripts
The scripts carry this copyright notice:
The sentences contradict each other, as COPYING.LIB contains the LGPL...
qapi-types/visit.py: Pass whole expr dict for structs
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>
qapi-types/visit.py: Inheritance for structs
This introduces a new 'base' key for struct definitions that refers toanother struct type. On the JSON level, the fields of the base type areincluded directly into the same namespace as the fields of the defined...
qapi-types.py: Fix enum struct sizes on i686
Unlike other list types, enum wasn't adding any padding, which causeda mismatch between the generated struct size and GenericList structsize. More details in a678e26cbe89f7a27cbce794c2c2784571ee9d21
This crashed qemu if calling qmp query-tpm-types for example, which...
qapi-types.py: Split off generate_struct_fields()
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: Flat unions with arbitrary discriminator
Instead of the rather verbose syntax that distinguishes base andsubclass fields...
{ "type": "file", "read-only": true, "data": { "filename": "test" } }
...we can now have both in the same namespace, allowing a more direct...
qapi-types.py: Implement 'base' for unions
The new 'base' key in a union definition refers to a struct type, whichis inlined into the union definition and can represent fields common toall kinds.
For example the following schema definition...
{ 'type': 'BlockOptionsBase', 'data': { 'read-only': 'bool' } }...
qapi: pad GenericList value fields to 64 bits
With the introduction of native list types, we now have types such asint64List where the 'value' field is not a pointer, but the actual64-bit value.
On 32-bit architectures, this can lead to situations where 'next' field...
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: move include files to include/qobject/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qapi-types.h: Don't include qemu-common.h
Needed to prevent build breakage when CPUState becomes a child ofDeviceState.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>[ehabkost: include <stdbool.h> too]Signed-off-by: Eduardo Habkost <ehabkost@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: generate list struct and visit_list for enum
Currently, if we define an 'enum' and use it in one command'sdata, list struct for enum could not be generated, but it'sused in qmp function.
For example: KeyCodesList could not be generated.
qapi-schema.json:...
qapi: don't convert enum strings to lowercase
Next commit will introduce enum strings in camel case.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-by: Markus Armbruster <armbru@redhat.com>
qapi: generate correct enum names for camel case enums
An enum like GenericError in the schema, should generateGENERIC_ERROR and not GENERICERROR.
qapi: qapi-types.h: don't include qapi/qapi-types-core.h
qapi-types.h needs only qemu-common.h. Including qapi-types-core.hcauses problems when qerror.h or error.h includes qapi-types.h.
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: complete implementation of unions
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Acked-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Fix qapi code generation fix
The fixes to qapi code generation had multiple bugs:- the Null class used to drop output was missing some methods- in some scripts it was never instantiated, leading to a None return, which is missing even more methods- the --source and --header options were swapped...
Fix qapi code generation wrt parallel build
Make's multiple output syntax
x.c x.h: x.template gen < x.template
actually invokes the command once for x.c and once for x.h (with differing $@in each invocation). During a parallel build, the two commands may be invoked...
qapi: allow a 'gen' key to suppress code generation
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qapi: Automatically generate a _MAX value for enums
It's the last value in the enum and is very useful for the Cimplementation.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.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: generate qapi_free_* functions for *List types
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi: Don't use c_var() on enum strings
Otherwise if we have something like 'foo-bar' in the schema,it will be generated as 'foo_bar' in the string lookup table.
c_var() is good for C variables, but not for enum strings.
qapi: add qapi-types.py code generator
This is the code generator for qapi types. It will generation thefollowing files:
$(prefix)qapi-types.h - C types corresponding to types defined in the schema you pass in $(prefix)qapi-types.c - Cleanup functions for the above C types...