Statistics
| Branch: | Revision:

root / scripts / qapi-types.py @ feature-archipelago

History | View | Annotate | Download (10.5 kB)

# Date Author Comment
678e48a2 03/03/2014 06:16 pm Markus Armbruster

qapi: Fix licensing of scripts

The scripts carry this copyright notice:

  1. This work is licensed under the terms of the GNU GPLv2.
  2. See the COPYING.LIB file in the top-level directory.

The sentences contradict each other, as COPYING.LIB contains the LGPL...

14d36307 10/11/2013 05:50 pm Kevin Wolf

qapi-types/visit.py: Pass whole expr dict for structs

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

622f557f 10/11/2013 05:50 pm Kevin Wolf

qapi-types/visit.py: Inheritance for structs

This introduces a new 'base' key for struct definitions that refers to
another struct type. On the JSON level, the fields of the base type are
included directly into the same namespace as the fields of the defined...

02dc4bf5 09/10/2013 05:09 pm Cole Robinson

qapi-types.py: Fix enum struct sizes on i686

Unlike other list types, enum wasn't adding any padding, which caused
a mismatch between the generated struct size and GenericList struct
size. More details in a678e26cbe89f7a27cbce794c2c2784571ee9d21

This crashed qemu if calling qmp query-tpm-types for example, which...

01537030 08/30/2013 04:28 pm Kevin Wolf

qapi-types.py: Split off generate_struct_fields()

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 } }...
50f2bdc7 07/26/2013 10:09 pm Kevin Wolf

qapi: Flat unions with arbitrary discriminator

Instead of the rather verbose syntax that distinguishes base and
subclass fields...

{ "type": "file",
"read-only": true,
"data": {
"filename": "test"
} }

...we can now have both in the same namespace, allowing a more direct...

e2503f5e 07/26/2013 09:17 pm Kevin Wolf

qapi-types.py: Implement 'base' for unions

The new 'base' key in a union definition refers to a struct type, which
is inlined into the union definition and can represent fields common to
all kinds.

For example the following schema definition...

{ 'type': 'BlockOptionsBase', 'data': { 'read-only': 'bool' } }...
a678e26c 05/30/2013 04:08 pm Michael Roth

qapi: pad GenericList value fields to 64 bits

With the introduction of native list types, we now have types such as
int64List where the 'value' field is not a pointer, but the actual
64-bit value.

On 32-bit architectures, this can lead to situations where 'next' field...

c0afa9c5 05/23/2013 04:44 pm Michael Roth

qapi: qapi-types.py, native list support

Teach type generators about native types so they can generate the
appropriate linked list types.

Signed-off-by: Michael Roth <>
Reviewed-by: Laszlo Ersek <>
Reviewed-by: Amos Kong <>...

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

qapi: move include files to include/qobject/

Signed-off-by: Paolo Bonzini <>

da4fea06 11/15/2012 03:46 am Igor Mammedov

qapi-types.h: Don't include qemu-common.h

Needed to prevent build breakage when CPUState becomes a child of
DeviceState.

Signed-off-by: Igor Mammedov <>
[ehabkost: include <stdbool.h> too]
Signed-off-by: Eduardo Habkost <>...

eda50a65 09/26/2012 04:45 pm Paolo Bonzini

qapi: do not protect enum values from namespace pollution

Enum values are always preceded by the uppercase name of the enum, so
they do not conflict with reserved words.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Luiz Capitulino <>

b9c4b48d 09/05/2012 09:48 pm Amos Kong

qapi: generate list struct and visit_list for enum

Currently, if we define an 'enum' and use it in one command's
data, list struct for enum could not be generated, but it's
used in qmp function.

For example: KeyCodesList could not be generated.

qapi-schema.json:...

ac4ff701 08/13/2012 07:21 pm Luiz Capitulino

qapi: don't convert enum strings to lowercase

Next commit will introduce enum strings in camel case.

Signed-off-by: Luiz Capitulino <>
Reviewed-by: Markus Armbruster <>

f01f594b 08/13/2012 07:21 pm Luiz Capitulino

qapi: generate correct enum names for camel case enums

An enum like GenericError in the schema, should generate
GENERIC_ERROR and not GENERICERROR.

Signed-off-by: Luiz Capitulino <>
Reviewed-by: Markus Armbruster <>

b68a8472 08/13/2012 07:20 pm Luiz Capitulino

qapi: qapi-types.h: don't include qapi/qapi-types-core.h

qapi-types.h needs only qemu-common.h. Including qapi-types-core.h
causes problems when qerror.h or error.h includes qapi-types.h.

Signed-off-by: Luiz Capitulino <>
Reviewed-by: Markus Armbruster <>

c9da228b 03/26/2012 09:21 pm Federico Simoncelli

qapi: add c_fun to escape function names

Signed-off-by: Federico Simoncelli <>
Signed-off-by: Anthony Liguori <>

dc8fb6df 03/12/2012 04:14 pm Paolo Bonzini

qapi: complete implementation of unions

Signed-off-by: Paolo Bonzini <>
Acked-by: Luiz Capitulino <>
Signed-off-by: Kevin Wolf <>

19bf7c87 01/12/2012 06:03 pm Avi Kivity

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

8d3bc517 12/27/2011 05:28 pm Avi Kivity

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

5dbee474 12/15/2011 05:20 pm Anthony Liguori

qapi: allow a 'gen' key to suppress code generation

Signed-off-by: Anthony Liguori <>

303b54b1 10/04/2011 05:00 pm Luiz Capitulino

qapi: Automatically generate a _MAX value for enums

It's the last value in the enum and is very useful for the C
implementation.

Signed-off-by: Luiz Capitulino <>

776574d6 10/04/2011 05:00 pm Anthony Liguori

qapi: add code generation support for middle mode

To get the ball rolling merging QAPI, this patch introduces a "middle mode" to
the code generator. In middle mode, the code generator generates marshalling
functions that are compatible with the current QMP server. We absolutely need...

75b96aca 10/04/2011 05:00 pm Michael Roth

qapi: generate qapi_free_* functions for *List types

Reviewed-by: Anthony Liguori <>
Signed-off-by: Michael Roth <>
Signed-off-by: Luiz Capitulino <>

d2a80d6b 10/04/2011 05:00 pm Luiz Capitulino

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.

Signed-off-by: Luiz Capitulino <>

fb3182ce 07/21/2011 10:48 pm Michael Roth

qapi: add qapi-types.py code generator

This is the code generator for qapi types. It will generation the
following 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...