Skip to content

Commit

Permalink
qapi: Move query-target from misc.json to machine.json
Browse files Browse the repository at this point in the history
Move query-target and its return type TargetInfo from misc.json to
machine.json, where they are covered by MAINTAINERS section "Machine
core".  Also move its implementation from arch_init.c to
hw/core/machine-qmp-cmds, where it is likewise covered.

All users of SysEmuTarget are now in machine.json.  Move it there from
common.json.

Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
Markus Armbruster committed Aug 21, 2019
1 parent 2e5b09f commit ffaee83
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 61 deletions.
11 changes: 0 additions & 11 deletions arch_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,3 @@ int xen_available(void)
return 0;
#endif
}


TargetInfo *qmp_query_target(Error **errp)
{
TargetInfo *info = g_malloc0(sizeof(*info));

info->arch = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME, -1,
&error_abort);

return info;
}
2 changes: 1 addition & 1 deletion docs/interop/firmware.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# = Firmware
##

{ 'include' : 'common.json' }
{ 'include' : 'machine.json' }
{ 'include' : 'block-core.json' }

##
Expand Down
10 changes: 10 additions & 0 deletions hw/core/machine-qmp-cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,16 @@ CurrentMachineParams *qmp_query_current_machine(Error **errp)
return params;
}

TargetInfo *qmp_query_target(Error **errp)
{
TargetInfo *info = g_malloc0(sizeof(*info));

info->arch = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME, -1,
&error_abort);

return info;
}

HotpluggableCPUList *qmp_query_hotpluggable_cpus(Error **errp)
{
MachineState *ms = MACHINE(qdev_get_machine());
Expand Down
25 changes: 0 additions & 25 deletions qapi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,28 +144,3 @@
##
{ 'enum': 'PCIELinkWidth',
'data': [ '1', '2', '4', '8', '12', '16', '32' ] }

##
# @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".
#
# ppcemb: dropped in 3.1
#
# Since: 3.0
##
{ 'enum' : 'SysEmuTarget',
'data' : [ 'aarch64', 'alpha', 'arm', 'cris', 'hppa', 'i386', 'lm32',
'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
'mips64el', 'mipsel', 'moxie', 'nios2', 'or1k', 'ppc',
'ppc64', 'riscv32', 'riscv64', 's390x', 'sh4',
'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32',
'x86_64', 'xtensa', 'xtensaeb' ] }
48 changes: 47 additions & 1 deletion qapi/machine.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,30 @@
# = Machines
##

{ 'include': 'common.json' }
##
# @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".
#
# ppcemb: dropped in 3.1
#
# Since: 3.0
##
{ 'enum' : 'SysEmuTarget',
'data' : [ 'aarch64', 'alpha', 'arm', 'cris', 'hppa', 'i386', 'lm32',
'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
'mips64el', 'mipsel', 'moxie', 'nios2', 'or1k', 'ppc',
'ppc64', 'riscv32', 'riscv64', 's390x', 'sh4',
'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32',
'x86_64', 'xtensa', 'xtensaeb' ] }

##
# @CpuInfoArch:
Expand Down Expand Up @@ -368,6 +391,29 @@
##
{ 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }

##
# @TargetInfo:
#
# Information describing the QEMU target.
#
# @arch: the target architecture
#
# Since: 1.2.0
##
{ 'struct': 'TargetInfo',
'data': { 'arch': 'SysEmuTarget' } }

##
# @query-target:
#
# Return information about the target for this QEMU
#
# Returns: TargetInfo
#
# Since: 1.2.0
##
{ 'command': 'query-target', 'returns': 'TargetInfo' }

##
# @NumaOptionsType:
#
Expand Down
23 changes: 0 additions & 23 deletions qapi/misc.json
Original file line number Diff line number Diff line change
Expand Up @@ -1341,29 +1341,6 @@
##
{ 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }

##
# @TargetInfo:
#
# Information describing the QEMU target.
#
# @arch: the target architecture
#
# Since: 1.2.0
##
{ 'struct': 'TargetInfo',
'data': { 'arch': 'SysEmuTarget' } }

##
# @query-target:
#
# Return information about the target for this QEMU
#
# Returns: TargetInfo
#
# Since: 1.2.0
##
{ 'command': 'query-target', 'returns': 'TargetInfo' }

##
# @AcpiTableOptions:
#
Expand Down

0 comments on commit ffaee83

Please sign in to comment.