From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: Laszlo Ersek <lersek@redhat.com>,
"Daniel P. Berrange" <berrange@redhat.com>,
Eric Blake <eblake@redhat.com>
Subject: [Qemu-devel] [PULL 07/10] qapi: add SysEmuTarget to "common.json"
Date: Fri, 4 May 2018 10:04:51 +0200 [thread overview]
Message-ID: <20180504080454.11014-8-armbru@redhat.com> (raw)
In-Reply-To: <20180504080454.11014-1-armbru@redhat.com>
From: Laszlo Ersek <lersek@redhat.com>
We'll soon need an enumeration type that lists all the softmmu targets
that QEMU (the project) supports. Introduce @SysEmuTarget to
"common.json".
The enum constant @x86_64 doesn't match the QAPI convention of preferring
hyphen ("-") over underscore ("_"). This is intentional; the @SysEmuTarget
constants are supposed to produce QEMU executable names when stringified
and appended to the "qemu-system-" prefix. Put differently, the
replacement text of the TARGET_NAME preprocessor macro must be possible to
look up in the list of (stringified) enum constants.
Like other enum types, @SysEmuTarget too can be used for discriminator
fields in unions. For the @i386 constant, a C-language union member called
"i386" would be generated. On mingw build hosts, "i386" is a macro
however. Add "i386" to "polluted_words" at once.
Cc: "Daniel P. Berrange" <berrange@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20180427192852.15013-3-lersek@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
qapi/common.json | 23 +++++++++++++++++++++++
scripts/qapi/common.py | 2 +-
2 files changed, 24 insertions(+), 1 deletion(-)
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/scripts/qapi/common.py b/scripts/qapi/common.py
index 3e14bc41f2..a032cec375 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -1822,7 +1822,7 @@ def c_name(name, protect=True):
'and', 'and_eq', 'bitand', 'bitor', 'compl', 'not',
'not_eq', 'or', 'or_eq', 'xor', 'xor_eq'])
# namespace pollution:
- polluted_words = set(['unix', 'errno', 'mips', 'sparc'])
+ polluted_words = set(['unix', 'errno', 'mips', 'sparc', 'i386'])
name = name.translate(c_name_trans)
if protect and (name in c89_words | c99_words | c11_words | gcc_words
| cpp_words | polluted_words):
--
2.13.6
next prev parent reply other threads:[~2018-05-04 8:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-04 8:04 [Qemu-devel] [PULL 00/10] QAPI patches for 2018-05-04 Markus Armbruster
2018-05-04 8:04 ` [Qemu-devel] [PULL 01/10] qobject: Use qobject_to() instead of type cast Markus Armbruster
2018-05-04 8:04 ` [Qemu-devel] [PULL 02/10] qobject: Ensure base is at offset 0 Markus Armbruster
2018-05-04 8:04 ` [Qemu-devel] [PULL 03/10] qobject: use a QObjectBase_ struct Markus Armbruster
2018-05-04 8:04 ` [Qemu-devel] [PULL 04/10] qobject: Replace qobject_incref/QINCREF qobject_decref/QDECREF Markus Armbruster
2018-05-04 8:04 ` [Qemu-devel] [PULL 05/10] qobject: Modify qobject_ref() to return obj Markus Armbruster
2018-05-04 8:04 ` [Qemu-devel] [PULL 06/10] qapi: fill in CpuInfoFast.arch in query-cpus-fast Markus Armbruster
2018-05-04 8:04 ` Markus Armbruster [this message]
2018-05-04 8:04 ` [Qemu-devel] [PULL 08/10] qapi: change the type of TargetInfo.arch from string to enum SysEmuTarget Markus Armbruster
2018-05-04 8:04 ` [Qemu-devel] [PULL 09/10] qapi: discriminate CpuInfoFast on SysEmuTarget, not CpuInfoArch Markus Armbruster
2018-05-04 8:04 ` [Qemu-devel] [PULL 10/10] qapi: deprecate CpuInfoFast.arch Markus Armbruster
2018-05-04 13:42 ` [Qemu-devel] [PULL 00/10] QAPI patches for 2018-05-04 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=20180504080454.11014-8-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=lersek@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).