mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
qapi: Add a primitive to include other files from a QAPI schema file
The primitive uses JSON syntax, and include paths are relative to the file using the directive: { 'include': 'path/to/file.json' } Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
33aaad529e
commit
a719a27c82
44 changed files with 110 additions and 13 deletions
1
tests/qapi-schema/include-before-err.err
Normal file
1
tests/qapi-schema/include-before-err.err
Normal file
|
@ -0,0 +1 @@
|
|||
tests/qapi-schema/include-before-err.json:2:13: Expected ":"
|
1
tests/qapi-schema/include-before-err.exit
Normal file
1
tests/qapi-schema/include-before-err.exit
Normal file
|
@ -0,0 +1 @@
|
|||
1
|
2
tests/qapi-schema/include-before-err.json
Normal file
2
tests/qapi-schema/include-before-err.json
Normal file
|
@ -0,0 +1,2 @@
|
|||
{ 'include': 'include-simple-sub.json' }
|
||||
{ 'command' 'missing-colon' }
|
0
tests/qapi-schema/include-before-err.out
Normal file
0
tests/qapi-schema/include-before-err.out
Normal file
1
tests/qapi-schema/include-cycle-b.json
Normal file
1
tests/qapi-schema/include-cycle-b.json
Normal file
|
@ -0,0 +1 @@
|
|||
{ 'include': 'include-cycle-c.json' }
|
1
tests/qapi-schema/include-cycle-c.json
Normal file
1
tests/qapi-schema/include-cycle-c.json
Normal file
|
@ -0,0 +1 @@
|
|||
{ 'include': 'include-cycle.json' }
|
3
tests/qapi-schema/include-cycle.err
Normal file
3
tests/qapi-schema/include-cycle.err
Normal file
|
@ -0,0 +1,3 @@
|
|||
In file included from tests/qapi-schema/include-cycle.json:1:
|
||||
In file included from include-cycle-b.json:1:
|
||||
include-cycle-c.json:1: Inclusion loop for include-cycle.json
|
1
tests/qapi-schema/include-cycle.exit
Normal file
1
tests/qapi-schema/include-cycle.exit
Normal file
|
@ -0,0 +1 @@
|
|||
1
|
1
tests/qapi-schema/include-cycle.json
Normal file
1
tests/qapi-schema/include-cycle.json
Normal file
|
@ -0,0 +1 @@
|
|||
{ 'include': 'include-cycle-b.json' }
|
0
tests/qapi-schema/include-cycle.out
Normal file
0
tests/qapi-schema/include-cycle.out
Normal file
1
tests/qapi-schema/include-format-err.err
Normal file
1
tests/qapi-schema/include-format-err.err
Normal file
|
@ -0,0 +1 @@
|
|||
tests/qapi-schema/include-format-err.json:1: Invalid 'include' directive
|
1
tests/qapi-schema/include-format-err.exit
Normal file
1
tests/qapi-schema/include-format-err.exit
Normal file
|
@ -0,0 +1 @@
|
|||
1
|
2
tests/qapi-schema/include-format-err.json
Normal file
2
tests/qapi-schema/include-format-err.json
Normal file
|
@ -0,0 +1,2 @@
|
|||
{ 'include': 'include-simple-sub.json',
|
||||
'foo': 'bar' }
|
0
tests/qapi-schema/include-format-err.out
Normal file
0
tests/qapi-schema/include-format-err.out
Normal file
2
tests/qapi-schema/include-nested-err.err
Normal file
2
tests/qapi-schema/include-nested-err.err
Normal file
|
@ -0,0 +1,2 @@
|
|||
In file included from tests/qapi-schema/include-nested-err.json:1:
|
||||
missing-colon.json:1:10: Expected ":"
|
1
tests/qapi-schema/include-nested-err.exit
Normal file
1
tests/qapi-schema/include-nested-err.exit
Normal file
|
@ -0,0 +1 @@
|
|||
1
|
1
tests/qapi-schema/include-nested-err.json
Normal file
1
tests/qapi-schema/include-nested-err.json
Normal file
|
@ -0,0 +1 @@
|
|||
{ 'include': 'missing-colon.json' }
|
0
tests/qapi-schema/include-nested-err.out
Normal file
0
tests/qapi-schema/include-nested-err.out
Normal file
1
tests/qapi-schema/include-no-file.err
Normal file
1
tests/qapi-schema/include-no-file.err
Normal file
|
@ -0,0 +1 @@
|
|||
tests/qapi-schema/include-no-file.json:1: No such file or directory: include-no-file-sub.json
|
1
tests/qapi-schema/include-no-file.exit
Normal file
1
tests/qapi-schema/include-no-file.exit
Normal file
|
@ -0,0 +1 @@
|
|||
1
|
1
tests/qapi-schema/include-no-file.json
Normal file
1
tests/qapi-schema/include-no-file.json
Normal file
|
@ -0,0 +1 @@
|
|||
{ 'include': 'include-no-file-sub.json' }
|
0
tests/qapi-schema/include-no-file.out
Normal file
0
tests/qapi-schema/include-no-file.out
Normal file
1
tests/qapi-schema/include-non-file.err
Normal file
1
tests/qapi-schema/include-non-file.err
Normal file
|
@ -0,0 +1 @@
|
|||
tests/qapi-schema/include-non-file.json:1: Expected a file name (string), got: ['foo', 'bar']
|
1
tests/qapi-schema/include-non-file.exit
Normal file
1
tests/qapi-schema/include-non-file.exit
Normal file
|
@ -0,0 +1 @@
|
|||
1
|
1
tests/qapi-schema/include-non-file.json
Normal file
1
tests/qapi-schema/include-non-file.json
Normal file
|
@ -0,0 +1 @@
|
|||
{ 'include': [ 'foo', 'bar' ] }
|
0
tests/qapi-schema/include-non-file.out
Normal file
0
tests/qapi-schema/include-non-file.out
Normal file
2
tests/qapi-schema/include-relpath-sub.json
Normal file
2
tests/qapi-schema/include-relpath-sub.json
Normal file
|
@ -0,0 +1,2 @@
|
|||
{ 'enum': 'Status',
|
||||
'data': [ 'good', 'bad', 'ugly' ] }
|
0
tests/qapi-schema/include-relpath.err
Normal file
0
tests/qapi-schema/include-relpath.err
Normal file
1
tests/qapi-schema/include-relpath.exit
Normal file
1
tests/qapi-schema/include-relpath.exit
Normal file
|
@ -0,0 +1 @@
|
|||
0
|
1
tests/qapi-schema/include-relpath.json
Normal file
1
tests/qapi-schema/include-relpath.json
Normal file
|
@ -0,0 +1 @@
|
|||
{ 'include': 'include/relpath.json' }
|
3
tests/qapi-schema/include-relpath.out
Normal file
3
tests/qapi-schema/include-relpath.out
Normal file
|
@ -0,0 +1,3 @@
|
|||
[OrderedDict([('enum', 'Status'), ('data', ['good', 'bad', 'ugly'])])]
|
||||
[{'enum_name': 'Status', 'enum_values': ['good', 'bad', 'ugly']}]
|
||||
[]
|
1
tests/qapi-schema/include-self-cycle.err
Normal file
1
tests/qapi-schema/include-self-cycle.err
Normal file
|
@ -0,0 +1 @@
|
|||
tests/qapi-schema/include-self-cycle.json:1: Inclusion loop for include-self-cycle.json
|
1
tests/qapi-schema/include-self-cycle.exit
Normal file
1
tests/qapi-schema/include-self-cycle.exit
Normal file
|
@ -0,0 +1 @@
|
|||
1
|
1
tests/qapi-schema/include-self-cycle.json
Normal file
1
tests/qapi-schema/include-self-cycle.json
Normal file
|
@ -0,0 +1 @@
|
|||
{ 'include': 'include-self-cycle.json' }
|
0
tests/qapi-schema/include-self-cycle.out
Normal file
0
tests/qapi-schema/include-self-cycle.out
Normal file
2
tests/qapi-schema/include-simple-sub.json
Normal file
2
tests/qapi-schema/include-simple-sub.json
Normal file
|
@ -0,0 +1,2 @@
|
|||
{ 'enum': 'Status',
|
||||
'data': [ 'good', 'bad', 'ugly' ] }
|
0
tests/qapi-schema/include-simple.err
Normal file
0
tests/qapi-schema/include-simple.err
Normal file
1
tests/qapi-schema/include-simple.exit
Normal file
1
tests/qapi-schema/include-simple.exit
Normal file
|
@ -0,0 +1 @@
|
|||
0
|
1
tests/qapi-schema/include-simple.json
Normal file
1
tests/qapi-schema/include-simple.json
Normal file
|
@ -0,0 +1 @@
|
|||
{ 'include': 'include-simple-sub.json' }
|
3
tests/qapi-schema/include-simple.out
Normal file
3
tests/qapi-schema/include-simple.out
Normal file
|
@ -0,0 +1,3 @@
|
|||
[OrderedDict([('enum', 'Status'), ('data', ['good', 'bad', 'ugly'])])]
|
||||
[{'enum_name': 'Status', 'enum_values': ['good', 'bad', 'ugly']}]
|
||||
[]
|
1
tests/qapi-schema/include/relpath.json
Normal file
1
tests/qapi-schema/include/relpath.json
Normal file
|
@ -0,0 +1 @@
|
|||
{ 'include': '../include-relpath-sub.json' }
|
Loading…
Add table
Add a link
Reference in a new issue