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

qapi: rename *qmp-*-visitor* to *qobject-*-visitor*

The QMP visitors have no direct dependency on QMP. It is
valid to use them anywhere that one has a QObject. Rename them
to better reflect their functionality as a generic QObject
to QAPI converter.

This is the first of three parts: rename the files. The next two
parts will rename C identifiers. The split is necessary to make git
rename detection work.

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Split into file and identifier rename, two comments touched up]
Signed-off-by: Markus Armbruster <armbru@redhat.com>

authored by

Daniel P. Berrange and committed by
Markus Armbruster
b3db211f ebfd93b6

+55 -55
+1 -1
block/qapi.c
··· 29 29 #include "block/write-threshold.h" 30 30 #include "qmp-commands.h" 31 31 #include "qapi-visit.h" 32 - #include "qapi/qmp-output-visitor.h" 32 + #include "qapi/qobject-output-visitor.h" 33 33 #include "qapi/qmp/types.h" 34 34 #include "sysemu/block-backend.h" 35 35 #include "qemu/cutils.h"
+1 -1
blockdev.c
··· 43 43 #include "qapi/qmp/types.h" 44 44 #include "qapi-visit.h" 45 45 #include "qapi/qmp/qerror.h" 46 - #include "qapi/qmp-output-visitor.h" 46 + #include "qapi/qobject-output-visitor.h" 47 47 #include "qapi/util.h" 48 48 #include "sysemu/sysemu.h" 49 49 #include "block/block_int.h"
+3 -3
include/qapi/qmp-input-visitor.h include/qapi/qobject-input-visitor.h
··· 11 11 * 12 12 */ 13 13 14 - #ifndef QMP_INPUT_VISITOR_H 15 - #define QMP_INPUT_VISITOR_H 14 + #ifndef QOBJECT_INPUT_VISITOR_H 15 + #define QOBJECT_INPUT_VISITOR_H 16 16 17 17 #include "qapi/visitor.h" 18 18 #include "qapi/qmp/qobject.h" ··· 20 20 typedef struct QmpInputVisitor QmpInputVisitor; 21 21 22 22 /* 23 - * Return a new input visitor that converts QMP to QAPI. 23 + * Return a new input visitor that converts a QObject to a QAPI object. 24 24 * 25 25 * Set @strict to reject a parse that doesn't consume all keys of a 26 26 * dictionary; otherwise excess input is ignored.
+3 -3
include/qapi/qmp-output-visitor.h include/qapi/qobject-output-visitor.h
··· 11 11 * 12 12 */ 13 13 14 - #ifndef QMP_OUTPUT_VISITOR_H 15 - #define QMP_OUTPUT_VISITOR_H 14 + #ifndef QOBJECT_OUTPUT_VISITOR_H 15 + #define QOBJECT_OUTPUT_VISITOR_H 16 16 17 17 #include "qapi/visitor.h" 18 18 #include "qapi/qmp/qobject.h" ··· 20 20 typedef struct QmpOutputVisitor QmpOutputVisitor; 21 21 22 22 /* 23 - * Create a new QMP output visitor. 23 + * Create a new QObject output visitor. 24 24 * 25 25 * If everything else succeeds, pass @result to visit_complete() to 26 26 * collect the result of the visit.
+3 -3
include/qapi/visitor.h
··· 25 25 * for doing work at each node of a QAPI graph; it can also be used 26 26 * for a virtual walk, where there is no actual QAPI C struct. 27 27 * 28 - * There are four kinds of visitor classes: input visitors (QMP, 28 + * There are four kinds of visitor classes: input visitors (QObject, 29 29 * string, and QemuOpts) parse an external representation and build 30 - * the corresponding QAPI graph, output visitors (QMP and string) take 30 + * the corresponding QAPI graph, output visitors (QObject and string) take 31 31 * a completed QAPI graph and generate an external representation, the 32 32 * dealloc visitor can take a QAPI graph (possibly partially 33 33 * constructed) and recursively free its resources, and the clone 34 34 * visitor performs a deep clone of one QAPI object to another. While 35 - * the dealloc and QMP input/output visitors are general, the string, 35 + * the dealloc and QObject input/output visitors are general, the string, 36 36 * QemuOpts, and clone visitors have some implementation limitations; 37 37 * see the documentation for each visitor for more details on what it 38 38 * supports. Also, see visitor-impl.h for the callback contracts
+1 -1
monitor.c
··· 950 950 * directly into QObject instead of first parsing it with 951 951 * visit_type_SchemaInfoList() into a SchemaInfoList, then marshal it 952 952 * to QObject with generated output marshallers, every time. Instead, 953 - * we do it in test-qmp-input-visitor.c, just to make sure 953 + * we do it in test-qobject-input-visitor.c, just to make sure 954 954 * qapi-introspect.py's output actually conforms to the schema. 955 955 */ 956 956 static void qmp_query_qmp_schema(QDict *qdict, QObject **ret_data,
+2 -2
qapi/Makefile.objs
··· 1 - util-obj-y = qapi-visit-core.o qapi-dealloc-visitor.o qmp-input-visitor.o 2 - util-obj-y += qmp-output-visitor.o qmp-registry.o qmp-dispatch.o 1 + util-obj-y = qapi-visit-core.o qapi-dealloc-visitor.o qobject-input-visitor.o 2 + util-obj-y += qobject-output-visitor.o qmp-registry.o qmp-dispatch.o 3 3 util-obj-y += string-input-visitor.o string-output-visitor.o 4 4 util-obj-y += opts-visitor.o qapi-clone-visitor.o 5 5 util-obj-y += qmp-event.o
+1 -1
qapi/qapi-clone-visitor.c
··· 110 110 assert(qcv->depth); 111 111 /* 112 112 * Pointer was already cloned by g_memdup; create fresh copy. 113 - * Note that as long as qmp-output-visitor accepts NULL instead of 113 + * Note that as long as qobject-output-visitor accepts NULL instead of 114 114 * "", then we must do likewise. However, we want to obey the 115 115 * input visitor semantics of never producing NULL when the empty 116 116 * string is intended.
+1 -1
qapi/qmp-input-visitor.c qapi/qobject-input-visitor.c
··· 14 14 15 15 #include "qemu/osdep.h" 16 16 #include "qapi/error.h" 17 - #include "qapi/qmp-input-visitor.h" 17 + #include "qapi/qobject-input-visitor.h" 18 18 #include "qapi/visitor-impl.h" 19 19 #include "qemu/queue.h" 20 20 #include "qemu-common.h"
+2 -2
qapi/qmp-output-visitor.c qapi/qobject-output-visitor.c
··· 13 13 */ 14 14 15 15 #include "qemu/osdep.h" 16 - #include "qapi/qmp-output-visitor.h" 16 + #include "qapi/qobject-output-visitor.h" 17 17 #include "qapi/visitor-impl.h" 18 18 #include "qemu/queue.h" 19 19 #include "qemu-common.h" ··· 152 152 static void qmp_output_type_uint64(Visitor *v, const char *name, uint64_t *obj, 153 153 Error **errp) 154 154 { 155 - /* FIXME: QMP outputs values larger than INT64_MAX as negative */ 155 + /* FIXME values larger than INT64_MAX become negative */ 156 156 QmpOutputVisitor *qov = to_qov(v); 157 157 qmp_output_add(qov, name, qint_from_int(*obj)); 158 158 }
+1 -1
qemu-img.c
··· 25 25 #include "qemu-version.h" 26 26 #include "qapi/error.h" 27 27 #include "qapi-visit.h" 28 - #include "qapi/qmp-output-visitor.h" 28 + #include "qapi/qobject-output-visitor.h" 29 29 #include "qapi/qmp/qerror.h" 30 30 #include "qapi/qmp/qjson.h" 31 31 #include "qemu/cutils.h"
+1 -1
qmp.c
··· 31 31 #include "qom/qom-qobject.h" 32 32 #include "qapi/qmp/qerror.h" 33 33 #include "qapi/qmp/qobject.h" 34 - #include "qapi/qmp-input-visitor.h" 34 + #include "qapi/qobject-input-visitor.h" 35 35 #include "hw/boards.h" 36 36 #include "qom/object_interfaces.h" 37 37 #include "hw/mem/pc-dimm.h"
+1 -1
qom/object_interfaces.c
··· 3 3 #include "qom/object_interfaces.h" 4 4 #include "qemu/module.h" 5 5 #include "qapi-visit.h" 6 - #include "qapi/qmp-output-visitor.h" 6 + #include "qapi/qobject-output-visitor.h" 7 7 #include "qapi/opts-visitor.h" 8 8 9 9 void user_creatable_complete(Object *obj, Error **errp)
+2 -2
qom/qom-qobject.c
··· 15 15 #include "qom/object.h" 16 16 #include "qom/qom-qobject.h" 17 17 #include "qapi/visitor.h" 18 - #include "qapi/qmp-input-visitor.h" 19 - #include "qapi/qmp-output-visitor.h" 18 + #include "qapi/qobject-input-visitor.h" 19 + #include "qapi/qobject-output-visitor.h" 20 20 21 21 void object_property_set_qobject(Object *obj, QObject *value, 22 22 const char *name, Error **errp)
+2 -2
scripts/qapi-commands.py
··· 293 293 #include "qapi/qmp/types.h" 294 294 #include "qapi/qmp/dispatch.h" 295 295 #include "qapi/visitor.h" 296 - #include "qapi/qmp-output-visitor.h" 297 - #include "qapi/qmp-input-visitor.h" 296 + #include "qapi/qobject-output-visitor.h" 297 + #include "qapi/qobject-input-visitor.h" 298 298 #include "qapi/dealloc-visitor.h" 299 299 #include "%(prefix)sqapi-types.h" 300 300 #include "%(prefix)sqapi-visit.h"
+1 -1
scripts/qapi-event.py
··· 209 209 #include "qemu-common.h" 210 210 #include "%(prefix)sqapi-event.h" 211 211 #include "%(prefix)sqapi-visit.h" 212 - #include "qapi/qmp-output-visitor.h" 212 + #include "qapi/qobject-output-visitor.h" 213 213 #include "qapi/qmp-event.h" 214 214 215 215 ''',
+1 -1
target-s390x/cpu_models.c
··· 17 17 #include "qapi/visitor.h" 18 18 #include "qemu/error-report.h" 19 19 #include "qapi/qmp/qerror.h" 20 - #include "qapi/qmp-input-visitor.h" 20 + #include "qapi/qobject-input-visitor.h" 21 21 #include "qapi/qmp/qbool.h" 22 22 #ifndef CONFIG_USER_ONLY 23 23 #include "sysemu/arch_init.h"
+3 -3
tests/.gitignore
··· 59 59 test-qmp-commands 60 60 test-qmp-commands.h 61 61 test-qmp-event 62 - test-qmp-input-strict 63 - test-qmp-input-visitor 62 + test-qobject-input-strict 63 + test-qobject-input-visitor 64 64 test-qmp-introspect.[ch] 65 65 test-qmp-marshal.c 66 - test-qmp-output-visitor 66 + test-qobject-output-visitor 67 67 test-rcu-list 68 68 test-replication 69 69 test-rfifolock
+10 -10
tests/Makefile.include
··· 22 22 gcov-files-check-qnull-y = qobject/qnull.c 23 23 check-unit-y += tests/check-qjson$(EXESUF) 24 24 gcov-files-check-qjson-y = qobject/qjson.c 25 - check-unit-y += tests/test-qmp-output-visitor$(EXESUF) 26 - gcov-files-test-qmp-output-visitor-y = qapi/qmp-output-visitor.c 25 + check-unit-y += tests/test-qobject-output-visitor$(EXESUF) 26 + gcov-files-test-qobject-output-visitor-y = qapi/qobject-output-visitor.c 27 27 check-unit-y += tests/test-clone-visitor$(EXESUF) 28 28 gcov-files-test-clone-visitor-y = qapi/qapi-clone-visitor.c 29 - check-unit-y += tests/test-qmp-input-visitor$(EXESUF) 30 - gcov-files-test-qmp-input-visitor-y = qapi/qmp-input-visitor.c 31 - check-unit-y += tests/test-qmp-input-strict$(EXESUF) 29 + check-unit-y += tests/test-qobject-input-visitor$(EXESUF) 30 + gcov-files-test-qobject-input-visitor-y = qapi/qobject-input-visitor.c 31 + check-unit-y += tests/test-qobject-input-strict$(EXESUF) 32 32 check-unit-y += tests/test-qmp-commands$(EXESUF) 33 33 gcov-files-test-qmp-commands-y = qapi/qmp-dispatch.c 34 34 check-unit-y += tests/test-string-input-visitor$(EXESUF) ··· 452 452 tests/check-qlist.o tests/check-qfloat.o tests/check-qnull.o \ 453 453 tests/check-qjson.o \ 454 454 tests/test-coroutine.o tests/test-string-output-visitor.o \ 455 - tests/test-string-input-visitor.o tests/test-qmp-output-visitor.o \ 455 + tests/test-string-input-visitor.o tests/test-qobject-output-visitor.o \ 456 456 tests/test-clone-visitor.o \ 457 - tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \ 457 + tests/test-qobject-input-visitor.o tests/test-qobject-input-strict.o \ 458 458 tests/test-qmp-commands.o tests/test-visitor-serialization.o \ 459 459 tests/test-x86-cpuid.o tests/test-mul64.o tests/test-int128.o \ 460 460 tests/test-opts-visitor.o tests/test-qmp-event.o \ ··· 558 558 tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) 559 559 tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) 560 560 tests/test-qmp-event$(EXESUF): tests/test-qmp-event.o $(test-qapi-obj-y) 561 - tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) 561 + tests/test-qobject-output-visitor$(EXESUF): tests/test-qobject-output-visitor.o $(test-qapi-obj-y) 562 562 tests/test-clone-visitor$(EXESUF): tests/test-clone-visitor.o $(test-qapi-obj-y) 563 - tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) 564 - tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) 563 + tests/test-qobject-input-visitor$(EXESUF): tests/test-qobject-input-visitor.o $(test-qapi-obj-y) 564 + tests/test-qobject-input-strict$(EXESUF): tests/test-qobject-input-strict.o $(test-qapi-obj-y) 565 565 tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) 566 566 tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) 567 567 tests/test-opts-visitor$(EXESUF): tests/test-opts-visitor.o $(test-qapi-obj-y)
+2 -2
tests/check-qnull.c
··· 10 10 11 11 #include "qapi/qmp/qobject.h" 12 12 #include "qemu-common.h" 13 - #include "qapi/qmp-input-visitor.h" 14 - #include "qapi/qmp-output-visitor.h" 13 + #include "qapi/qobject-input-visitor.h" 14 + #include "qapi/qobject-output-visitor.h" 15 15 #include "qapi/error.h" 16 16 17 17 /*
+1 -1
tests/test-qmp-commands.c
··· 4 4 #include "test-qmp-commands.h" 5 5 #include "qapi/qmp/dispatch.h" 6 6 #include "qemu/module.h" 7 - #include "qapi/qmp-input-visitor.h" 7 + #include "qapi/qobject-input-visitor.h" 8 8 #include "tests/test-qapi-types.h" 9 9 #include "tests/test-qapi-visit.h" 10 10
+2 -2
tests/test-qmp-input-strict.c tests/test-qobject-input-strict.c
··· 1 1 /* 2 - * QMP Input Visitor unit-tests (strict mode). 2 + * QObject Input Visitor unit-tests (strict mode). 3 3 * 4 4 * Copyright (C) 2011-2012, 2015 Red Hat Inc. 5 5 * ··· 15 15 16 16 #include "qemu-common.h" 17 17 #include "qapi/error.h" 18 - #include "qapi/qmp-input-visitor.h" 18 + #include "qapi/qobject-input-visitor.h" 19 19 #include "test-qapi-types.h" 20 20 #include "test-qapi-visit.h" 21 21 #include "qapi/qmp/types.h"
+2 -2
tests/test-qmp-input-visitor.c tests/test-qobject-input-visitor.c
··· 1 1 /* 2 - * QMP Input Visitor unit-tests. 2 + * QObject Input Visitor unit-tests. 3 3 * 4 4 * Copyright (C) 2011-2016 Red Hat Inc. 5 5 * ··· 14 14 15 15 #include "qemu-common.h" 16 16 #include "qapi/error.h" 17 - #include "qapi/qmp-input-visitor.h" 17 + #include "qapi/qobject-input-visitor.h" 18 18 #include "test-qapi-types.h" 19 19 #include "test-qapi-visit.h" 20 20 #include "qapi/qmp/types.h"
+2 -2
tests/test-qmp-output-visitor.c tests/test-qobject-output-visitor.c
··· 1 1 /* 2 - * QMP Output Visitor unit-tests. 2 + * QObject Output Visitor unit-tests. 3 3 * 4 4 * Copyright (C) 2011-2016 Red Hat Inc. 5 5 * ··· 14 14 15 15 #include "qemu-common.h" 16 16 #include "qapi/error.h" 17 - #include "qapi/qmp-output-visitor.h" 17 + #include "qapi/qobject-output-visitor.h" 18 18 #include "test-qapi-types.h" 19 19 #include "test-qapi-visit.h" 20 20 #include "qapi/qmp/types.h"
+1 -1
tests/test-string-input-visitor.c
··· 4 4 * Copyright (C) 2012 Red Hat Inc. 5 5 * 6 6 * Authors: 7 - * Paolo Bonzini <pbonzini@redhat.com> (based on test-qmp-input-visitor) 7 + * Paolo Bonzini <pbonzini@redhat.com> (based on test-qobject-input-visitor) 8 8 * 9 9 * This work is licensed under the terms of the GNU GPL, version 2 or later. 10 10 * See the COPYING file in the top-level directory.
+1 -1
tests/test-string-output-visitor.c
··· 4 4 * Copyright (C) 2012 Red Hat Inc. 5 5 * 6 6 * Authors: 7 - * Paolo Bonzini <pbonzini@redhat.com> (based on test-qmp-output-visitor) 7 + * Paolo Bonzini <pbonzini@redhat.com> (based on test-qobject-output-visitor) 8 8 * 9 9 * This work is licensed under the terms of the GNU GPL, version 2 or later. 10 10 * See the COPYING file in the top-level directory.
+2 -2
tests/test-visitor-serialization.c
··· 20 20 #include "qapi/error.h" 21 21 #include "qapi/qmp/types.h" 22 22 #include "qapi/qmp/qjson.h" 23 - #include "qapi/qmp-input-visitor.h" 24 - #include "qapi/qmp-output-visitor.h" 23 + #include "qapi/qobject-input-visitor.h" 24 + #include "qapi/qobject-output-visitor.h" 25 25 #include "qapi/string-input-visitor.h" 26 26 #include "qapi/string-output-visitor.h" 27 27 #include "qapi-types.h"
+2 -2
util/qemu-sockets.c
··· 21 21 #include "qapi/error.h" 22 22 #include "qemu/sockets.h" 23 23 #include "qemu/main-loop.h" 24 - #include "qapi/qmp-input-visitor.h" 25 - #include "qapi/qmp-output-visitor.h" 24 + #include "qapi/qobject-input-visitor.h" 25 + #include "qapi/qobject-output-visitor.h" 26 26 #include "qapi-visit.h" 27 27 #include "qemu/cutils.h" 28 28