qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

qapi: Move qapi-schema.json to qapi/, rename generated files

Move qapi-schema.json to qapi/, so it's next to its modules, and all
files get generated to qapi/, not just the ones generated for modules.

Consistently name the generated files qapi-MODULE.EXT:
qmp-commands.[ch] become qapi-commands.[ch], qapi-event.[ch] become
qapi-events.[ch], and qmp-introspect.[ch] become qapi-introspect.[ch].
This gets rid of the temporary hacks in scripts/qapi/commands.py,
scripts/qapi/events.py, and scripts/qapi/common.py.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180211093607.27351-28-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
[eblake: Fix trailing dot in tpm.c, undo temporary hack for OSX toolchain]
Signed-off-by: Eric Blake <eblake@redhat.com>

authored by

Markus Armbruster and committed by
Eric Blake
eb815e24 bb46af41

+119 -134
+8 -8
.gitignore
··· 29 29 /qga/qapi-generated 30 30 /qapi-generated 31 31 /qapi-gen-timestamp 32 - /qapi-builtin-types.[ch] 33 - /qapi-builtin-visit.[ch] 32 + /qapi/qapi-builtin-types.[ch] 33 + /qapi/qapi-builtin-visit.[ch] 34 34 /qapi/qapi-commands-block-core.[ch] 35 35 /qapi/qapi-commands-block.[ch] 36 36 /qapi/qapi-commands-char.[ch] ··· 47 47 /qapi/qapi-commands-trace.[ch] 48 48 /qapi/qapi-commands-transaction.[ch] 49 49 /qapi/qapi-commands-ui.[ch] 50 + /qapi/qapi-commands.[ch] 50 51 /qapi/qapi-events-block-core.[ch] 51 52 /qapi/qapi-events-block.[ch] 52 53 /qapi/qapi-events-char.[ch] ··· 63 64 /qapi/qapi-events-trace.[ch] 64 65 /qapi/qapi-events-transaction.[ch] 65 66 /qapi/qapi-events-ui.[ch] 67 + /qapi/qapi-events.[ch] 68 + /qapi/qapi-introspect.[ch] 66 69 /qapi/qapi-types-block-core.[ch] 67 70 /qapi/qapi-types-block.[ch] 68 71 /qapi/qapi-types-char.[ch] ··· 79 82 /qapi/qapi-types-trace.[ch] 80 83 /qapi/qapi-types-transaction.[ch] 81 84 /qapi/qapi-types-ui.[ch] 82 - /qapi-types.[ch] 85 + /qapi/qapi-types.[ch] 83 86 /qapi/qapi-visit-block-core.[ch] 84 87 /qapi/qapi-visit-block.[ch] 85 88 /qapi/qapi-visit-char.[ch] ··· 96 99 /qapi/qapi-visit-trace.[ch] 97 100 /qapi/qapi-visit-transaction.[ch] 98 101 /qapi/qapi-visit-ui.[ch] 99 - /qapi-visit.[ch] 100 - /qapi-event.[ch] 101 - /qapi-doc.texi 102 - /qmp-commands.[ch] 103 - /qmp-introspect.[ch] 102 + /qapi/qapi-visit.[ch] 103 + /qapi/qapi-doc.texi 104 104 /qemu-doc.html 105 105 /qemu-doc.info 106 106 /qemu-doc.txt
+21 -21
Makefile
··· 90 90 include $(SRC_PATH)/rules.mak 91 91 92 92 GENERATED_FILES = qemu-version.h config-host.h qemu-options.def 93 - GENERATED_FILES += qapi-builtin-types.h qapi-builtin-types.c 94 - GENERATED_FILES += qapi-types.h qapi-types.c 93 + GENERATED_FILES += qapi/qapi-builtin-types.h qapi/qapi-builtin-types.c 94 + GENERATED_FILES += qapi/qapi-types.h qapi/qapi-types.c 95 95 GENERATED_FILES += qapi/qapi-types-block-core.h qapi/qapi-types-block-core.c 96 96 GENERATED_FILES += qapi/qapi-types-block.h qapi/qapi-types-block.c 97 97 GENERATED_FILES += qapi/qapi-types-char.h qapi/qapi-types-char.c ··· 108 108 GENERATED_FILES += qapi/qapi-types-trace.h qapi/qapi-types-trace.c 109 109 GENERATED_FILES += qapi/qapi-types-transaction.h qapi/qapi-types-transaction.c 110 110 GENERATED_FILES += qapi/qapi-types-ui.h qapi/qapi-types-ui.c 111 - GENERATED_FILES += qapi-builtin-visit.h qapi-builtin-visit.c 112 - GENERATED_FILES += qapi-visit.h qapi-visit.c 111 + GENERATED_FILES += qapi/qapi-builtin-visit.h qapi/qapi-builtin-visit.c 112 + GENERATED_FILES += qapi/qapi-visit.h qapi/qapi-visit.c 113 113 GENERATED_FILES += qapi/qapi-visit-block-core.h qapi/qapi-visit-block-core.c 114 114 GENERATED_FILES += qapi/qapi-visit-block.h qapi/qapi-visit-block.c 115 115 GENERATED_FILES += qapi/qapi-visit-char.h qapi/qapi-visit-char.c ··· 126 126 GENERATED_FILES += qapi/qapi-visit-trace.h qapi/qapi-visit-trace.c 127 127 GENERATED_FILES += qapi/qapi-visit-transaction.h qapi/qapi-visit-transaction.c 128 128 GENERATED_FILES += qapi/qapi-visit-ui.h qapi/qapi-visit-ui.c 129 - GENERATED_FILES += qmp-commands.h qmp-commands.c 129 + GENERATED_FILES += qapi/qapi-commands.h qapi/qapi-commands.c 130 130 GENERATED_FILES += qapi/qapi-commands-block-core.h qapi/qapi-commands-block-core.c 131 131 GENERATED_FILES += qapi/qapi-commands-block.h qapi/qapi-commands-block.c 132 132 GENERATED_FILES += qapi/qapi-commands-char.h qapi/qapi-commands-char.c ··· 143 143 GENERATED_FILES += qapi/qapi-commands-trace.h qapi/qapi-commands-trace.c 144 144 GENERATED_FILES += qapi/qapi-commands-transaction.h qapi/qapi-commands-transaction.c 145 145 GENERATED_FILES += qapi/qapi-commands-ui.h qapi/qapi-commands-ui.c 146 - GENERATED_FILES += qapi-event.h qapi-event.c 146 + GENERATED_FILES += qapi/qapi-events.h qapi/qapi-events.c 147 147 GENERATED_FILES += qapi/qapi-events-block-core.h qapi/qapi-events-block-core.c 148 148 GENERATED_FILES += qapi/qapi-events-block.h qapi/qapi-events-block.c 149 149 GENERATED_FILES += qapi/qapi-events-char.h qapi/qapi-events-char.c ··· 160 160 GENERATED_FILES += qapi/qapi-events-trace.h qapi/qapi-events-trace.c 161 161 GENERATED_FILES += qapi/qapi-events-transaction.h qapi/qapi-events-transaction.c 162 162 GENERATED_FILES += qapi/qapi-events-ui.h qapi/qapi-events-ui.c 163 - GENERATED_FILES += qmp-introspect.c qmp-introspect.h 164 - GENERATED_FILES += qapi-doc.texi 163 + GENERATED_FILES += qapi/qapi-introspect.c qapi/qapi-introspect.h 164 + GENERATED_FILES += qapi/qapi-doc.texi 165 165 166 166 GENERATED_FILES += trace/generated-tcg-tracers.h 167 167 ··· 562 562 563 563 qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h \ 564 564 qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h \ 565 - qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-commands.c \ 565 + qga/qapi-generated/qga-qapi-commands.h qga/qapi-generated/qga-qapi-commands.c \ 566 566 qga/qapi-generated/qga-qapi-doc.texi: \ 567 567 qga/qapi-generated/qapi-gen-timestamp ; 568 568 qga/qapi-generated/qapi-gen-timestamp: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py) ··· 571 571 "GEN","$(@:%-timestamp=%)") 572 572 @>$@ 573 573 574 - qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \ 574 + qapi-modules = $(SRC_PATH)/qapi/qapi-schema.json $(SRC_PATH)/qapi/common.json \ 575 575 $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \ 576 576 $(SRC_PATH)/qapi/char.json \ 577 577 $(SRC_PATH)/qapi/crypto.json \ ··· 587 587 $(SRC_PATH)/qapi/transaction.json \ 588 588 $(SRC_PATH)/qapi/ui.json 589 589 590 - qapi-builtin-types.c qapi-builtin-types.h \ 591 - qapi-types.c qapi-types.h \ 590 + qapi/qapi-builtin-types.c qapi/qapi-builtin-types.h \ 591 + qapi/qapi-types.c qapi/qapi-types.h \ 592 592 qapi/qapi-types-block-core.c qapi/qapi-types-block-core.h \ 593 593 qapi/qapi-types-block.c qapi/qapi-types-block.h \ 594 594 qapi/qapi-types-char.c qapi/qapi-types-char.h \ ··· 605 605 qapi/qapi-types-trace.c qapi/qapi-types-trace.h \ 606 606 qapi/qapi-types-transaction.c qapi/qapi-types-transaction.h \ 607 607 qapi/qapi-types-ui.c qapi/qapi-types-ui.h \ 608 - qapi-builtin-visit.c qapi-builtin-visit.h \ 609 - qapi-visit.c qapi-visit.h \ 608 + qapi/qapi-builtin-visit.c qapi/qapi-builtin-visit.h \ 609 + qapi/qapi-visit.c qapi/qapi-visit.h \ 610 610 qapi/qapi-visit-block-core.c qapi/qapi-visit-block-core.h \ 611 611 qapi/qapi-visit-block.c qapi/qapi-visit-block.h \ 612 612 qapi/qapi-visit-char.c qapi/qapi-visit-char.h \ ··· 623 623 qapi/qapi-visit-trace.c qapi/qapi-visit-trace.h \ 624 624 qapi/qapi-visit-transaction.c qapi/qapi-visit-transaction.h \ 625 625 qapi/qapi-visit-ui.c qapi/qapi-visit-ui.h \ 626 - qmp-commands.h qmp-commands.c \ 626 + qapi/qapi-commands.h qapi/qapi-commands.c \ 627 627 qapi/qapi-commands-block-core.c qapi/qapi-commands-block-core.h \ 628 628 qapi/qapi-commands-block.c qapi/qapi-commands-block.h \ 629 629 qapi/qapi-commands-char.c qapi/qapi-commands-char.h \ ··· 640 640 qapi/qapi-commands-trace.c qapi/qapi-commands-trace.h \ 641 641 qapi/qapi-commands-transaction.c qapi/qapi-commands-transaction.h \ 642 642 qapi/qapi-commands-ui.c qapi/qapi-commands-ui.h \ 643 - qapi-event.c qapi-event.h \ 643 + qapi/qapi-events.c qapi/qapi-events.h \ 644 644 qapi/qapi-events-block-core.c qapi/qapi-events-block-core.h \ 645 645 qapi/qapi-events-block.c qapi/qapi-events-block.h \ 646 646 qapi/qapi-events-char.c qapi/qapi-events-char.h \ ··· 657 657 qapi/qapi-events-trace.c qapi/qapi-events-trace.h \ 658 658 qapi/qapi-events-transaction.c qapi/qapi-events-transaction.h \ 659 659 qapi/qapi-events-ui.c qapi/qapi-events-ui.h \ 660 - qmp-introspect.h qmp-introspect.c \ 661 - qapi-doc.texi: \ 660 + qapi/qapi-introspect.h qapi/qapi-introspect.c \ 661 + qapi/qapi-doc.texi: \ 662 662 qapi-gen-timestamp ; 663 663 qapi-gen-timestamp: $(qapi-modules) $(qapi-py) 664 664 $(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi-gen.py \ 665 - -o "." -b $<, \ 665 + -o "qapi" -b $<, \ 666 666 "GEN","$(@:%-timestamp=%)") 667 667 @>$@ 668 668 669 - QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) 669 + QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qapi-commands.h) 670 670 $(qga-obj-y): $(QGALIB_GEN) 671 671 672 672 qemu-ga$(EXESUF): $(qga-obj-y) $(COMMON_LDADDS) ··· 933 933 qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool 934 934 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@") 935 935 936 - docs/interop/qemu-qmp-qapi.texi: qapi-doc.texi 936 + docs/interop/qemu-qmp-qapi.texi: qapi/qapi-doc.texi 937 937 @cp -p $< $@ 938 938 939 939 docs/interop/qemu-ga-qapi.texi: qga/qapi-generated/qga-qapi-doc.texi
+11 -10
Makefile.objs
··· 2 2 # Common libraries for tools and emulators 3 3 stub-obj-y = stubs/ crypto/ 4 4 util-obj-y = util/ qobject/ qapi/ 5 - util-obj-y += qapi-builtin-types.o 6 - util-obj-y += qapi-types.o 5 + util-obj-y += qapi/qapi-builtin-types.o 6 + util-obj-y += qapi/qapi-types.o 7 7 util-obj-y += qapi/qapi-types-block-core.o 8 8 util-obj-y += qapi/qapi-types-block.o 9 9 util-obj-y += qapi/qapi-types-char.o ··· 20 20 util-obj-y += qapi/qapi-types-trace.o 21 21 util-obj-y += qapi/qapi-types-transaction.o 22 22 util-obj-y += qapi/qapi-types-ui.o 23 - util-obj-y += qapi-builtin-visit.o 24 - util-obj-y += qapi-visit.o 23 + util-obj-y += qapi/qapi-builtin-visit.o 24 + util-obj-y += qapi/qapi-visit.o 25 25 util-obj-y += qapi/qapi-visit-block-core.o 26 26 util-obj-y += qapi/qapi-visit-block.o 27 27 util-obj-y += qapi/qapi-visit-char.o ··· 38 38 util-obj-y += qapi/qapi-visit-trace.o 39 39 util-obj-y += qapi/qapi-visit-transaction.o 40 40 util-obj-y += qapi/qapi-visit-ui.o 41 - util-obj-y += qapi-event.o 41 + util-obj-y += qapi/qapi-events.o 42 42 util-obj-y += qapi/qapi-events-block-core.o 43 43 util-obj-y += qapi/qapi-events-block.o 44 44 util-obj-y += qapi/qapi-events-char.o ··· 55 55 util-obj-y += qapi/qapi-events-trace.o 56 56 util-obj-y += qapi/qapi-events-transaction.o 57 57 util-obj-y += qapi/qapi-events-ui.o 58 - util-obj-y += qmp-introspect.o 58 + util-obj-y += qapi/qapi-introspect.o 59 59 60 60 chardev-obj-y = chardev/ 61 61 ··· 131 131 ###################################################################### 132 132 # qapi 133 133 134 - common-obj-y += qmp-commands.o 134 + common-obj-y += qapi/qapi-commands.o 135 135 common-obj-y += qapi/qapi-commands-block-core.o 136 136 common-obj-y += qapi/qapi-commands-block.o 137 137 common-obj-y += qapi/qapi-commands-char.o ··· 148 148 common-obj-y += qapi/qapi-commands-trace.o 149 149 common-obj-y += qapi/qapi-commands-transaction.o 150 150 common-obj-y += qapi/qapi-commands-ui.o 151 - common-obj-y += qmp-introspect.o 151 + common-obj-y += qapi/qapi-introspect.o 152 152 common-obj-y += qmp.o hmp.o 153 153 endif 154 154 ··· 171 171 ###################################################################### 172 172 # guest agent 173 173 174 - # FIXME: a few definitions from qapi-types.o/qapi-visit.o are needed 175 - # by libqemuutil.a. These should be moved to a separate .json schema. 174 + # FIXME: a few definitions from qapi/qapi-types.o and 175 + # qapi/qapi-visit.o are needed by libqemuutil.a. These should be 176 + # extracted into a QAPI schema module, or perhaps a separate schema. 176 177 qga-obj-y = qga/ 177 178 qga-vss-dll-obj-y = qga/ 178 179
+1 -1
backends/hostmem.c
··· 14 14 #include "sysemu/hostmem.h" 15 15 #include "hw/boards.h" 16 16 #include "qapi/error.h" 17 - #include "qapi-builtin-visit.h" 17 + #include "qapi/qapi-builtin-visit.h" 18 18 #include "qapi/visitor.h" 19 19 #include "qemu/config-file.h" 20 20 #include "qom/object_interfaces.h"
+15 -15
docs/devel/qapi-code-gen.txt
··· 647 647 of all event names with a generated _MAX value at the end. When 648 648 'data' is also specified, additional info will be included in the 649 649 event, with similar semantics to a 'struct' expression. Finally there 650 - will be C API generated in qapi-event.h; when called by QEMU code, a 650 + will be C API generated in qapi-events.h; when called by QEMU code, a 651 651 message with timestamp will be emitted on the wire. 652 652 653 653 An example event is: ··· 1147 1147 1148 1148 The following files are generated: 1149 1149 1150 - $(prefix)qmp-commands.c: Command marshal/dispatch functions for each 1151 - QMP command defined in the schema 1150 + $(prefix)qapi-commands.c: Command marshal/dispatch functions for each 1151 + QMP command defined in the schema 1152 1152 1153 - $(prefix)qmp-commands.h: Function prototypes for the QMP commands 1154 - specified in the schema 1153 + $(prefix)qapi-commands.h: Function prototypes for the QMP commands 1154 + specified in the schema 1155 1155 1156 1156 Example: 1157 1157 1158 - $ cat qapi-generated/example-qmp-commands.h 1158 + $ cat qapi-generated/example-qapi-commands.h 1159 1159 [Uninteresting stuff omitted...] 1160 1160 1161 1161 #ifndef EXAMPLE_QMP_COMMANDS_H ··· 1170 1170 void qmp_marshal_my_command(QDict *args, QObject **ret, Error **errp); 1171 1171 1172 1172 #endif 1173 - $ cat qapi-generated/example-qmp-commands.c 1173 + $ cat qapi-generated/example-qapi-commands.c 1174 1174 [Uninteresting stuff omitted...] 1175 1175 1176 1176 static void qmp_marshal_output_UserDefOne(UserDefOne *ret_in, QObject **ret_out, Error **errp) ··· 1243 1243 1244 1244 The following files are created: 1245 1245 1246 - $(prefix)qapi-event.h - Function prototypes for each event type, plus an 1246 + $(prefix)qapi-events.h - Function prototypes for each event type, plus an 1247 1247 enumeration of all event names 1248 1248 1249 - $(prefix)qapi-event.c - Implementation of functions to send an event 1249 + $(prefix)qapi-events.c - Implementation of functions to send an event 1250 1250 1251 1251 Example: 1252 1252 1253 - $ cat qapi-generated/example-qapi-event.h 1253 + $ cat qapi-generated/example-qapi-events.h 1254 1254 [Uninteresting stuff omitted...] 1255 1255 1256 1256 #ifndef EXAMPLE_QAPI_EVENT_H ··· 1273 1273 extern const char *const example_QAPIEvent_lookup[]; 1274 1274 1275 1275 #endif 1276 - $ cat qapi-generated/example-qapi-event.c 1276 + $ cat qapi-generated/example-qapi-events.c 1277 1277 [Uninteresting stuff omitted...] 1278 1278 1279 1279 void qapi_event_send_my_event(Error **errp) ··· 1306 1306 1307 1307 The following files are created: 1308 1308 1309 - $(prefix)qmp-introspect.c - Defines a string holding a JSON 1309 + $(prefix)qapi-introspect.c - Defines a string holding a JSON 1310 1310 description of the schema 1311 1311 1312 - $(prefix)qmp-introspect.h - Declares the above string 1312 + $(prefix)qapi-introspect.h - Declares the above string 1313 1313 1314 1314 Example: 1315 1315 1316 - $ cat qapi-generated/example-qmp-introspect.h 1316 + $ cat qapi-generated/example-qapi-introspect.h 1317 1317 [Uninteresting stuff omitted...] 1318 1318 1319 1319 #ifndef EXAMPLE_QMP_INTROSPECT_H ··· 1322 1322 extern const char example_qmp_schema_json[]; 1323 1323 1324 1324 #endif 1325 - $ cat qapi-generated/example-qmp-introspect.c 1325 + $ cat qapi-generated/example-qapi-introspect.c 1326 1326 [Uninteresting stuff omitted...] 1327 1327 1328 1328 const char example_qmp_schema_json[] = "["
+1 -1
docs/devel/writing-qmp-commands.txt
··· 419 419 allocated by the implementation. This is so because the QAPI also generates 420 420 a function to free its types and it cannot distinguish between dynamically 421 421 or statically allocated strings 422 - 6. You have to include "qapi/qmp-commands-misc.h" in qemu-timer.c 422 + 6. You have to include "qapi/qapi-commands-misc.h" in qemu-timer.c 423 423 424 424 Time to test the new command. Build qemu, run it as described in the "Testing" 425 425 section and try this:
+1 -1
docs/interop/qmp-intro.txt
··· 79 79 } 80 80 81 81 Please refer to docs/interop/qemu-qmp-ref.* for a complete command 82 - reference, generated from qapi-schema.json. 82 + reference, generated from qapi/qapi-schema.json. 83 83 84 84 QMP wiki page 85 85 -------------
+1 -1
hmp.c
··· 28 28 #include "monitor/qdev.h" 29 29 #include "qapi/error.h" 30 30 #include "qapi/opts-visitor.h" 31 - #include "qapi-builtin-visit.h" 31 + #include "qapi/qapi-builtin-visit.h" 32 32 #include "qapi/qapi-commands-block.h" 33 33 #include "qapi/qapi-commands-char.h" 34 34 #include "qapi/qapi-commands-migration.h"
+1 -1
include/qapi/qmp/qobject.h
··· 32 32 #ifndef QOBJECT_H 33 33 #define QOBJECT_H 34 34 35 - #include "qapi-builtin-types.h" 35 + #include "qapi/qapi-builtin-types.h" 36 36 37 37 struct QObject { 38 38 QType type;
+1 -1
include/qapi/visitor.h
··· 15 15 #ifndef QAPI_VISITOR_H 16 16 #define QAPI_VISITOR_H 17 17 18 - #include "qapi-builtin-types.h" 18 + #include "qapi/qapi-builtin-types.h" 19 19 20 20 /* 21 21 * The QAPI schema defines both a set of C data types, and a QMP wire
+1 -1
include/qom/object.h
··· 14 14 #ifndef QEMU_OBJECT_H 15 15 #define QEMU_OBJECT_H 16 16 17 - #include "qapi-builtin-types.h" 17 + #include "qapi/qapi-builtin-types.h" 18 18 #include "qemu/queue.h" 19 19 20 20 struct TypeImpl;
+3 -3
monitor.c
··· 69 69 #include "exec/exec-all.h" 70 70 #include "qemu/log.h" 71 71 #include "qemu/option.h" 72 - #include "qmp-commands.h" 73 72 #include "hmp.h" 74 73 #include "qemu/thread.h" 75 74 #include "block/qapi.h" 75 + #include "qapi/qapi-commands.h" 76 + #include "qapi/qapi-events.h" 76 77 #include "qapi/error.h" 77 78 #include "qapi/qmp-event.h" 78 - #include "qapi-event.h" 79 - #include "qmp-introspect.h" 79 + #include "qapi/qapi-introspect.h" 80 80 #include "sysemu/qtest.h" 81 81 #include "sysemu/cpus.h" 82 82 #include "qemu/cutils.h"
+1 -1
net/filter-buffer.c
··· 13 13 #include "qemu-common.h" 14 14 #include "qemu/timer.h" 15 15 #include "qemu/iov.h" 16 - #include "qapi-builtin-visit.h" 16 + #include "qapi/qapi-builtin-visit.h" 17 17 #include "qapi/qmp/qerror.h" 18 18 #include "qom/object.h" 19 19
+16 -16
qapi-schema.json qapi/qapi-schema.json
··· 76 76 # included sub-schemas inserted at the first include directive 77 77 # (subsequent include directives have no effect). To get a sane and 78 78 # stable order, it's best to include each sub-schema just once, or 79 - # include it first in qapi-schema.json. 79 + # include it first right here. 80 80 81 - { 'include': 'qapi/common.json' } 82 - { 'include': 'qapi/sockets.json' } 83 - { 'include': 'qapi/run-state.json' } 84 - { 'include': 'qapi/crypto.json' } 85 - { 'include': 'qapi/block.json' } 86 - { 'include': 'qapi/char.json' } 87 - { 'include': 'qapi/net.json' } 88 - { 'include': 'qapi/rocker.json' } 89 - { 'include': 'qapi/tpm.json' } 90 - { 'include': 'qapi/ui.json' } 91 - { 'include': 'qapi/migration.json' } 92 - { 'include': 'qapi/transaction.json' } 93 - { 'include': 'qapi/trace.json' } 94 - { 'include': 'qapi/introspect.json' } 95 - { 'include': 'qapi/misc.json' } 81 + { 'include': 'common.json' } 82 + { 'include': 'sockets.json' } 83 + { 'include': 'run-state.json' } 84 + { 'include': 'crypto.json' } 85 + { 'include': 'block.json' } 86 + { 'include': 'char.json' } 87 + { 'include': 'net.json' } 88 + { 'include': 'rocker.json' } 89 + { 'include': 'tpm.json' } 90 + { 'include': 'ui.json' } 91 + { 'include': 'migration.json' } 92 + { 'include': 'transaction.json' } 93 + { 'include': 'trace.json' } 94 + { 'include': 'introspect.json' } 95 + { 'include': 'misc.json' }
+2 -2
qapi/misc.json
··· 1729 1729 # 1730 1730 # Emitted when background dump has completed 1731 1731 # 1732 - # @result: DumpQueryResult type described in qapi-schema.json. 1732 + # @result: final dump status 1733 1733 # 1734 1734 # @error: human-readable error string that provides 1735 1735 # hint on why dump failed. Only presents on failure. The ··· 2944 2944 # 2945 2945 # Emitted when guest executes ACPI _OST method. 2946 2946 # 2947 - # @info: ACPIOSTInfo type as described in qapi-schema.json 2947 + # @info: OSPM Status Indication 2948 2948 # 2949 2949 # Since: 2.1 2950 2950 #
+1 -1
qga/Makefile.objs
··· 3 3 qga-obj-$(CONFIG_WIN32) += commands-win32.o channel-win32.o service-win32.o 4 4 qga-obj-$(CONFIG_WIN32) += vss-win32.o 5 5 qga-obj-y += qapi-generated/qga-qapi-types.o qapi-generated/qga-qapi-visit.o 6 - qga-obj-y += qapi-generated/qga-qmp-commands.o 6 + qga-obj-y += qapi-generated/qga-qapi-commands.o 7 7 8 8 qga-vss-dll-obj-$(CONFIG_QGA_VSS) += vss-win32/
+1 -1
qga/commands-posix.c
··· 17 17 #include <sys/wait.h> 18 18 #include <dirent.h> 19 19 #include "qga/guest-agent-core.h" 20 - #include "qga-qmp-commands.h" 20 + #include "qga-qapi-commands.h" 21 21 #include "qapi/error.h" 22 22 #include "qapi/qmp/qerror.h" 23 23 #include "qemu/queue.h"
+1 -1
qga/commands-win32.c
··· 34 34 35 35 #include "qga/guest-agent-core.h" 36 36 #include "qga/vss-win32.h" 37 - #include "qga-qmp-commands.h" 37 + #include "qga-qapi-commands.h" 38 38 #include "qapi/error.h" 39 39 #include "qapi/qmp/qerror.h" 40 40 #include "qemu/queue.h"
+1 -1
qga/commands.c
··· 12 12 13 13 #include "qemu/osdep.h" 14 14 #include "qga/guest-agent-core.h" 15 - #include "qga-qmp-commands.h" 15 + #include "qga-qapi-commands.h" 16 16 #include "qapi/error.h" 17 17 #include "qapi/qmp/qerror.h" 18 18 #include "qemu/base64.h"
+1 -1
qga/main.c
··· 25 25 #include "qapi/qmp/qstring.h" 26 26 #include "qga/guest-agent-core.h" 27 27 #include "qemu/module.h" 28 - #include "qga-qmp-commands.h" 28 + #include "qga-qapi-commands.h" 29 29 #include "qapi/qmp/qerror.h" 30 30 #include "qapi/error.h" 31 31 #include "qga/channel.h"
+1 -1
qom/object.c
··· 18 18 #include "qapi/visitor.h" 19 19 #include "qapi/string-input-visitor.h" 20 20 #include "qapi/string-output-visitor.h" 21 - #include "qapi-builtin-visit.h" 21 + #include "qapi/qapi-builtin-visit.h" 22 22 #include "qapi/qmp/qerror.h" 23 23 #include "trace.h" 24 24
-7
scripts/qapi/commands.py
··· 232 232 self._regy = '' 233 233 self._visited_ret_types = {} 234 234 235 - # Temporary HACK: 236 - def _module_basename(self, what, name): 237 - basename = QAPISchemaModularCVisitor._module_basename(self, what, name) 238 - if name == self._main_module: 239 - return re.sub(r'qapi-commands', 'qmp-commands', basename) 240 - return basename 241 - 242 235 def _begin_module(self, name): 243 236 self._visited_ret_types[self._genc] = set() 244 237 commands = self._module_basename('qapi-commands', name)
+2 -3
scripts/qapi/common.py
··· 1775 1775 type_name = prefix 1776 1776 return camel_to_upper(type_name) + '_' + c_name(const_name, False).upper() 1777 1777 1778 - # Temporary HACK for '/': 1779 1778 if hasattr(str, 'maketrans'): 1780 - c_name_trans = str.maketrans('.-/', '___') 1779 + c_name_trans = str.maketrans('.-', '__') 1781 1780 else: 1782 - c_name_trans = string.maketrans('.-/', '___') 1781 + c_name_trans = string.maketrans('.-', '__') 1783 1782 1784 1783 1785 1784 # Map @name to a valid C identifier.
+1 -8
scripts/qapi/events.py
··· 157 157 self._enum_name = c_name(prefix + 'QAPIEvent', protect=False) 158 158 self._event_names = [] 159 159 160 - # Temporary HACK: 161 - def _module_basename(self, what, name): 162 - basename = QAPISchemaModularCVisitor._module_basename(self, what, name) 163 - if name == self._main_module: 164 - return re.sub(r'qapi-events', 'qapi-event', basename) 165 - return basename 166 - 167 160 def _begin_module(self, name): 168 161 types = self._module_basename('qapi-types', name) 169 162 visit = self._module_basename('qapi-visit', name) 170 163 self._genc.add(mcgen(''' 171 164 #include "qemu/osdep.h" 172 165 #include "qemu-common.h" 173 - #include "%(prefix)sqapi-event.h" 166 + #include "%(prefix)sqapi-events.h" 174 167 #include "%(visit)s.h" 175 168 #include "qapi/error.h" 176 169 #include "qapi/qmp/qdict.h"
+2 -2
scripts/qapi/introspect.py
··· 44 44 45 45 def __init__(self, prefix, unmask): 46 46 QAPISchemaMonolithicCVisitor.__init__( 47 - self, prefix, 'qmp-introspect', 47 + self, prefix, 'qapi-introspect', 48 48 ' * QAPI/QMP schema introspection', __doc__) 49 49 self._unmask = unmask 50 50 self._schema = None ··· 53 53 self._name_map = {} 54 54 self._genc.add(mcgen(''' 55 55 #include "qemu/osdep.h" 56 - #include "%(prefix)sqmp-introspect.h" 56 + #include "%(prefix)sqapi-introspect.h" 57 57 58 58 ''', 59 59 prefix=prefix))
+3 -3
scripts/qapi/types.py
··· 177 177 self._genc.preamble_add(mcgen(''' 178 178 #include "qemu/osdep.h" 179 179 #include "qapi/dealloc-visitor.h" 180 - #include "qapi-builtin-types.h" 181 - #include "qapi-builtin-visit.h" 180 + #include "qapi/qapi-builtin-types.h" 181 + #include "qapi/qapi-builtin-visit.h" 182 182 ''')) 183 183 self._genh.preamble_add(mcgen(''' 184 184 #include "qapi/util.h" ··· 195 195 ''', 196 196 types=types, visit=visit)) 197 197 self._genh.preamble_add(mcgen(''' 198 - #include "qapi-builtin-types.h" 198 + #include "qapi/qapi-builtin-types.h" 199 199 ''')) 200 200 201 201 def visit_begin(self, schema):
+3 -3
scripts/qapi/visit.py
··· 274 274 #include "qemu/osdep.h" 275 275 #include "qemu-common.h" 276 276 #include "qapi/error.h" 277 - #include "qapi-builtin-visit.h" 277 + #include "qapi/qapi-builtin-visit.h" 278 278 ''')) 279 279 self._genh.preamble_add(mcgen(''' 280 280 #include "qapi/visitor.h" 281 - #include "qapi-builtin-types.h" 281 + #include "qapi/qapi-builtin-types.h" 282 282 283 283 ''', 284 284 prefix=prefix)) ··· 295 295 ''', 296 296 visit=visit, prefix=self._prefix)) 297 297 self._genh.preamble_add(mcgen(''' 298 - #include "qapi-builtin-visit.h" 298 + #include "qapi/qapi-builtin-visit.h" 299 299 #include "%(types)s.h" 300 300 301 301 ''',
+3 -3
tests/.gitignore
··· 60 60 test-logging 61 61 test-mul64 62 62 test-opts-visitor 63 - test-qapi-event.[ch] 63 + test-qapi-commands.[ch] 64 + test-qapi-events.[ch] 64 65 test-qapi-types.[ch] 65 66 test-qapi-util 66 67 test-qapi-visit.[ch] ··· 71 72 test-qht 72 73 test-qht-par 73 74 test-qmp-cmds 74 - test-qmp-commands.[ch] 75 75 test-qmp-event 76 76 test-qobject-input-strict 77 77 test-qobject-input-visitor 78 - test-qmp-introspect.[ch] 78 + test-qapi-introspect.[ch] 79 79 test-qobject-output-visitor 80 80 test-rcu-list 81 81 test-replication
+7 -7
tests/Makefile.include
··· 570 570 check-qapi-schema-y := $(addprefix tests/qapi-schema/, $(qapi-schema)) 571 571 572 572 GENERATED_FILES += tests/test-qapi-types.h tests/test-qapi-visit.h \ 573 - tests/test-qmp-commands.h tests/test-qapi-event.h \ 574 - tests/test-qmp-introspect.h 573 + tests/test-qapi-commands.h tests/test-qapi-events.h \ 574 + tests/test-qapi-introspect.h 575 575 576 576 test-obj-y = tests/check-qnum.o tests/check-qstring.o tests/check-qdict.o \ 577 577 tests/check-qlist.o tests/check-qnull.o tests/check-qobject.o \ ··· 596 596 test-util-obj-y = libqemuutil.a 597 597 test-qom-obj-y = $(qom-obj-y) $(test-util-obj-y) 598 598 test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o \ 599 - tests/test-qapi-event.o tests/test-qmp-introspect.o \ 599 + tests/test-qapi-events.o tests/test-qapi-introspect.o \ 600 600 $(test-qom-obj-y) 601 601 benchmark-crypto-obj-y = $(crypto-obj-y) $(test-qom-obj-y) 602 602 test-crypto-obj-y = $(crypto-obj-y) $(test-qom-obj-y) ··· 660 660 661 661 tests/test-qapi-types.c tests/test-qapi-types.h \ 662 662 tests/test-qapi-visit.c tests/test-qapi-visit.h \ 663 - tests/test-qmp-commands.h tests/test-qmp-commands.c \ 664 - tests/test-qapi-event.c tests/test-qapi-event.h \ 665 - tests/test-qmp-introspect.c tests/test-qmp-introspect.h: \ 663 + tests/test-qapi-commands.h tests/test-qapi-commands.c \ 664 + tests/test-qapi-events.c tests/test-qapi-events.h \ 665 + tests/test-qapi-introspect.c tests/test-qapi-introspect.h: \ 666 666 tests/test-qapi-gen-timestamp ; 667 667 tests/test-qapi-gen-timestamp: $(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(qapi-py) 668 668 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \ ··· 683 683 tests/test-qobject-output-visitor$(EXESUF): tests/test-qobject-output-visitor.o $(test-qapi-obj-y) 684 684 tests/test-clone-visitor$(EXESUF): tests/test-clone-visitor.o $(test-qapi-obj-y) 685 685 tests/test-qobject-input-visitor$(EXESUF): tests/test-qobject-input-visitor.o $(test-qapi-obj-y) 686 - tests/test-qmp-cmds$(EXESUF): tests/test-qmp-cmds.o tests/test-qmp-commands.o $(test-qapi-obj-y) 686 + tests/test-qmp-cmds$(EXESUF): tests/test-qmp-cmds.o tests/test-qapi-commands.o $(test-qapi-obj-y) 687 687 tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) 688 688 tests/test-opts-visitor$(EXESUF): tests/test-opts-visitor.o $(test-qapi-obj-y) 689 689
+1 -1
tests/test-qmp-cmds.c
··· 3 3 #include "qapi/qmp/qdict.h" 4 4 #include "qapi/qmp/qnum.h" 5 5 #include "qapi/qmp/qstring.h" 6 - #include "test-qmp-commands.h" 7 6 #include "qapi/error.h" 8 7 #include "qemu/module.h" 9 8 #include "qapi/qobject-input-visitor.h" 10 9 #include "tests/test-qapi-types.h" 11 10 #include "tests/test-qapi-visit.h" 11 + #include "test-qapi-commands.h" 12 12 13 13 static QmpCommandList qmp_commands; 14 14
+1 -1
tests/test-qmp-event.c
··· 14 14 #include "qemu/osdep.h" 15 15 16 16 #include "qemu-common.h" 17 - #include "test-qapi-event.h" 18 17 #include "qapi/error.h" 19 18 #include "qapi/qmp/qbool.h" 20 19 #include "qapi/qmp/qdict.h" 21 20 #include "qapi/qmp/qnum.h" 22 21 #include "qapi/qmp/qstring.h" 23 22 #include "qapi/qmp-event.h" 23 + #include "test-qapi-events.h" 24 24 25 25 typedef struct TestEventData { 26 26 QDict *expect;
+3 -3
tests/test-qobject-input-visitor.c
··· 24 24 #include "qapi/qmp/qnum.h" 25 25 #include "qapi/qmp/qstring.h" 26 26 #include "qapi/qmp/qjson.h" 27 - #include "test-qmp-introspect.h" 28 - #include "qmp-introspect.h" 27 + #include "test-qapi-introspect.h" 28 + #include "qapi/qapi-introspect.h" 29 29 30 30 typedef struct TestInputVisitorData { 31 31 QObject *obj; ··· 1376 1376 NULL, test_visitor_in_fail_alternate); 1377 1377 input_visitor_test_add("/visitor/input/fail/union-native-list", 1378 1378 NULL, test_visitor_in_fail_union_native_list); 1379 - input_visitor_test_add("/visitor/input/qmp-introspect", 1379 + input_visitor_test_add("/visitor/input/qapi-introspect", 1380 1380 NULL, test_visitor_in_qmp_introspect); 1381 1381 1382 1382 g_test_run();
+1 -2
tpm.c
··· 181 181 } 182 182 183 183 /* 184 - * Walk the list of active TPM backends and collect information about them 185 - * following the schema description in qapi-schema.json. 184 + * Walk the list of active TPM backends and collect information about them. 186 185 */ 187 186 TPMInfoList *qmp_query_tpm(Error **errp) 188 187 {
+1 -1
ui/cocoa.m
··· 32 32 #include "ui/input.h" 33 33 #include "sysemu/sysemu.h" 34 34 #include "qapi/error.h" 35 - #include "qmp-commands.h" 35 + #include "qapi/qapi-commands.h" 36 36 #include "sysemu/blockdev.h" 37 37 #include "qemu-version.h" 38 38 #include <Carbon/Carbon.h>
+1 -1
ui/vnc.c
··· 35 35 #include "qemu/timer.h" 36 36 #include "qemu/acl.h" 37 37 #include "qemu/config-file.h" 38 + #include "qapi/qapi-events.h" 38 39 #include "qapi/error.h" 39 40 #include "qapi/qapi-commands-ui.h" 40 41 #include "ui/input.h" 41 - #include "qapi-event.h" 42 42 #include "crypto/hash.h" 43 43 #include "crypto/tlscredsanon.h" 44 44 #include "crypto/tlscredsx509.h"