qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 2/4] qapi: Move query-target from misc.json to machine.json
Date: Wed, 21 Aug 2019 18:08:01 +0200	[thread overview]
Message-ID: <20190821160803.10026-3-armbru@redhat.com> (raw)
In-Reply-To: <20190821160803.10026-1-armbru@redhat.com>

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 <armbru@redhat.com>
Message-Id: <20190709152053.16670-3-armbru@redhat.com>
---
 docs/interop/firmware.json |  2 +-
 qapi/common.json           | 25 --------------------
 qapi/machine.json          | 48 +++++++++++++++++++++++++++++++++++++-
 qapi/misc.json             | 23 ------------------
 arch_init.c                | 11 ---------
 hw/core/machine-qmp-cmds.c | 10 ++++++++
 6 files changed, 58 insertions(+), 61 deletions(-)

diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
index ff8c2ce5f2..8ffb7856d2 100644
--- a/docs/interop/firmware.json
+++ b/docs/interop/firmware.json
@@ -13,7 +13,7 @@
 # = Firmware
 ##
 
-{ 'include' : 'common.json' }
+{ 'include' : 'machine.json' }
 { 'include' : 'block-core.json' }
 
 ##
diff --git a/qapi/common.json b/qapi/common.json
index 3d4e8de1e0..7b9cbcd97b 100644
--- a/qapi/common.json
+++ b/qapi/common.json
@@ -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' ] }
diff --git a/qapi/machine.json b/qapi/machine.json
index 6db8a7e2ec..de5c742d72 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -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:
@@ -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:
 #
diff --git a/qapi/misc.json b/qapi/misc.json
index a7fba7230c..6bd11f50e6 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -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:
 #
diff --git a/arch_init.c b/arch_init.c
index 74b0708634..0a1531124c 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -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;
-}
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 526fbd5ced..15cf7c62e3 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -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());
-- 
2.21.0



  parent reply	other threads:[~2019-08-21 16:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-21 16:07 [Qemu-devel] [PULL 0/4] Monitor patches for 2019-08-21 Markus Armbruster
2019-08-21 16:08 ` [Qemu-devel] [PULL 1/4] hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ Markus Armbruster
2019-08-21 16:08 ` Markus Armbruster [this message]
2019-08-21 16:08 ` [Qemu-devel] [PULL 3/4] qdev: Collect HMP handlers command handlers in qdev-monitor.c Markus Armbruster
2019-08-21 16:08 ` [Qemu-devel] [PULL 4/4] monitor/qmp: Update comment for commit 4eaca8de268 Markus Armbruster
2019-08-22 12:13 ` [Qemu-devel] [PULL 0/4] Monitor patches for 2019-08-21 Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190821160803.10026-3-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).