diff options
Diffstat (limited to 'qapi')
-rw-r--r-- | qapi/common.json | 23 | ||||
-rw-r--r-- | qapi/misc.json | 68 | ||||
-rw-r--r-- | qapi/qapi-dealloc-visitor.c | 4 | ||||
-rw-r--r-- | qapi/qmp-dispatch.c | 6 | ||||
-rw-r--r-- | qapi/qobject-input-visitor.c | 10 | ||||
-rw-r--r-- | qapi/qobject-output-visitor.c | 11 |
6 files changed, 88 insertions, 34 deletions
diff --git a/qapi/common.json b/qapi/common.json index d9b14dd429..c811d04984 100644 --- a/qapi/common.json +++ b/qapi/common.json @@ -126,3 +126,26 @@ ## { 'enum': 'OffAutoPCIBAR', 'data': [ 'off', 'auto', 'bar0', 'bar1', 'bar2', 'bar3', 'bar4', 'bar5' ] } + +## +# @SysEmuTarget: +# +# The comprehensive enumeration of QEMU system emulation ("softmmu") +# targets. Run "./configure --help" in the project root directory, and +# look for the *-softmmu targets near the "--target-list" option. The +# individual target constants are not documented here, for the time +# being. +# +# Notes: The resulting QMP strings can be appended to the "qemu-system-" +# prefix to produce the corresponding QEMU executable name. This +# is true even for "qemu-system-x86_64". +# +# Since: 2.13 +## +{ 'enum' : 'SysEmuTarget', + 'data' : [ 'aarch64', 'alpha', 'arm', 'cris', 'hppa', 'i386', 'lm32', + 'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64', + 'mips64el', 'mipsel', 'moxie', 'nios2', 'or1k', 'ppc', + 'ppc64', 'ppcemb', 'riscv32', 'riscv64', 's390x', 'sh4', + 'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32', + 'x86_64', 'xtensa', 'xtensaeb' ] } diff --git a/qapi/misc.json b/qapi/misc.json index 5636f4a149..f5988cc0b5 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -5,6 +5,8 @@ # = Miscellanea ## +{ 'include': 'common.json' } + ## # @qmp_capabilities: # @@ -556,25 +558,55 @@ # @props: properties describing to which node/socket/core/thread # virtual CPU belongs to, provided if supported by board # -# @arch: architecture of the cpu, which determines which additional fields -# will be listed +# @arch: base architecture of the cpu; deprecated since 2.13.0 in favor +# of @target +# +# @target: the QEMU system emulation target, which determines which +# additional fields will be listed (since 2.13) # # Since: 2.12 # ## -{ 'union': 'CpuInfoFast', - 'base': {'cpu-index': 'int', 'qom-path': 'str', - 'thread-id': 'int', '*props': 'CpuInstanceProperties', - 'arch': 'CpuInfoArch' }, - 'discriminator': 'arch', - 'data': { 'x86': 'CpuInfoOther', - 'sparc': 'CpuInfoOther', - 'ppc': 'CpuInfoOther', - 'mips': 'CpuInfoOther', - 'tricore': 'CpuInfoOther', - 's390': 'CpuInfoS390', - 'riscv': 'CpuInfoRISCV', - 'other': 'CpuInfoOther' } } +{ 'union' : 'CpuInfoFast', + 'base' : { 'cpu-index' : 'int', + 'qom-path' : 'str', + 'thread-id' : 'int', + '*props' : 'CpuInstanceProperties', + 'arch' : 'CpuInfoArch', + 'target' : 'SysEmuTarget' }, + 'discriminator' : 'target', + 'data' : { 'aarch64' : 'CpuInfoOther', + 'alpha' : 'CpuInfoOther', + 'arm' : 'CpuInfoOther', + 'cris' : 'CpuInfoOther', + 'hppa' : 'CpuInfoOther', + 'i386' : 'CpuInfoOther', + 'lm32' : 'CpuInfoOther', + 'm68k' : 'CpuInfoOther', + 'microblaze' : 'CpuInfoOther', + 'microblazeel' : 'CpuInfoOther', + 'mips' : 'CpuInfoOther', + 'mips64' : 'CpuInfoOther', + 'mips64el' : 'CpuInfoOther', + 'mipsel' : 'CpuInfoOther', + 'moxie' : 'CpuInfoOther', + 'nios2' : 'CpuInfoOther', + 'or1k' : 'CpuInfoOther', + 'ppc' : 'CpuInfoOther', + 'ppc64' : 'CpuInfoOther', + 'ppcemb' : 'CpuInfoOther', + 'riscv32' : 'CpuInfoOther', + 'riscv64' : 'CpuInfoOther', + 's390x' : 'CpuInfoS390', + 'sh4' : 'CpuInfoOther', + 'sh4eb' : 'CpuInfoOther', + 'sparc' : 'CpuInfoOther', + 'sparc64' : 'CpuInfoOther', + 'tricore' : 'CpuInfoOther', + 'unicore32' : 'CpuInfoOther', + 'x86_64' : 'CpuInfoOther', + 'xtensa' : 'CpuInfoOther', + 'xtensaeb' : 'CpuInfoOther' } } ## # @query-cpus-fast: @@ -600,6 +632,7 @@ # }, # "qom-path": "/machine/unattached/device[0]", # "arch":"x86", +# "target":"x86_64", # "cpu-index": 0 # }, # { @@ -611,6 +644,7 @@ # }, # "qom-path": "/machine/unattached/device[2]", # "arch":"x86", +# "target":"x86_64", # "cpu-index": 1 # } # ] @@ -2449,12 +2483,12 @@ # # Information describing the QEMU target. # -# @arch: the target architecture (eg "x86_64", "i386", etc) +# @arch: the target architecture # # Since: 1.2.0 ## { 'struct': 'TargetInfo', - 'data': { 'arch': 'str' } } + 'data': { 'arch': 'SysEmuTarget' } } ## # @query-target: diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c index fd23803166..6b24afd367 100644 --- a/qapi/qapi-dealloc-visitor.c +++ b/qapi/qapi-dealloc-visitor.c @@ -99,7 +99,7 @@ static void qapi_dealloc_type_anything(Visitor *v, const char *name, QObject **obj, Error **errp) { if (obj) { - qobject_decref(*obj); + qobject_unref(*obj); } } @@ -107,7 +107,7 @@ static void qapi_dealloc_type_null(Visitor *v, const char *name, QNull **obj, Error **errp) { if (obj) { - QDECREF(*obj); + qobject_unref(*obj); } } diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index dd05907265..f9377b27fd 100644 --- a/qapi/qmp-dispatch.c +++ b/qapi/qmp-dispatch.c @@ -105,7 +105,7 @@ static QObject *do_qmp_dispatch(QmpCommandList *cmds, QObject *request, args = qdict_new(); } else { args = qdict_get_qdict(dict, "arguments"); - QINCREF(args); + qobject_ref(args); } cmd->fn(args, &ret, &local_err); @@ -117,7 +117,7 @@ static QObject *do_qmp_dispatch(QmpCommandList *cmds, QObject *request, ret = QOBJECT(qdict_new()); } - QDECREF(args); + qobject_unref(args); return ret; } @@ -166,7 +166,7 @@ QObject *qmp_dispatch(QmpCommandList *cmds, QObject *request) } else if (ret) { qdict_put_obj(rsp, "return", ret); } else { - QDECREF(rsp); + qobject_unref(rsp); return NULL; } diff --git a/qapi/qobject-input-visitor.c b/qapi/qobject-input-visitor.c index a7569d5dce..da57f4cc24 100644 --- a/qapi/qobject-input-visitor.c +++ b/qapi/qobject-input-visitor.c @@ -588,8 +588,7 @@ static void qobject_input_type_any(Visitor *v, const char *name, QObject **obj, return; } - qobject_incref(qobj); - *obj = qobj; + *obj = qobject_ref(qobj); } static void qobject_input_type_null(Visitor *v, const char *name, @@ -652,7 +651,7 @@ static void qobject_input_free(Visitor *v) qobject_input_stack_object_free(tos); } - qobject_decref(qiv->root); + qobject_unref(qiv->root); if (qiv->errname) { g_string_free(qiv->errname, TRUE); } @@ -677,8 +676,7 @@ static QObjectInputVisitor *qobject_input_visitor_base_new(QObject *obj) v->visitor.optional = qobject_input_optional; v->visitor.free = qobject_input_free; - v->root = obj; - qobject_incref(obj); + v->root = qobject_ref(obj); return v; } @@ -744,7 +742,7 @@ Visitor *qobject_input_visitor_new_str(const char *str, } v = qobject_input_visitor_new_keyval(QOBJECT(args)); } - QDECREF(args); + qobject_unref(args); return v; } diff --git a/qapi/qobject-output-visitor.c b/qapi/qobject-output-visitor.c index 877e37eeb8..89ffd8a7bf 100644 --- a/qapi/qobject-output-visitor.c +++ b/qapi/qobject-output-visitor.c @@ -188,8 +188,8 @@ static void qobject_output_type_any(Visitor *v, const char *name, QObject **obj, Error **errp) { QObjectOutputVisitor *qov = to_qov(v); - qobject_incref(*obj); - qobject_output_add_obj(qov, name, *obj); + + qobject_output_add_obj(qov, name, qobject_ref(*obj)); } static void qobject_output_type_null(Visitor *v, const char *name, @@ -201,7 +201,7 @@ static void qobject_output_type_null(Visitor *v, const char *name, /* Finish building, and return the root object. * The root object is never null. The caller becomes the object's - * owner, and should use qobject_decref() when done with it. */ + * owner, and should use qobject_unref() when done with it. */ static void qobject_output_complete(Visitor *v, void *opaque) { QObjectOutputVisitor *qov = to_qov(v); @@ -210,8 +210,7 @@ static void qobject_output_complete(Visitor *v, void *opaque) assert(qov->root && QSLIST_EMPTY(&qov->stack)); assert(opaque == qov->result); - qobject_incref(qov->root); - *qov->result = qov->root; + *qov->result = qobject_ref(qov->root); qov->result = NULL; } @@ -226,7 +225,7 @@ static void qobject_output_free(Visitor *v) g_free(e); } - qobject_decref(qov->root); + qobject_unref(qov->root); g_free(qov); } |