Blame SOURCES/kvm-qapi-add-SysEmuTarget-to-common.json.patch

7711c0
From f156a5a4d6e4afbe88e0485771f87db2a17aa75e Mon Sep 17 00:00:00 2001
7711c0
From: Laszlo Ersek <lersek@redhat.com>
7711c0
Date: Tue, 13 Nov 2018 18:16:35 +0100
7711c0
Subject: [PATCH 16/22] qapi: add SysEmuTarget to "common.json"
7711c0
MIME-Version: 1.0
7711c0
Content-Type: text/plain; charset=UTF-8
7711c0
Content-Transfer-Encoding: 8bit
7711c0
7711c0
RH-Author: Laszlo Ersek <lersek@redhat.com>
7711c0
Message-id: <20181113181639.4999-3-lersek@redhat.com>
7711c0
Patchwork-id: 83008
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 2/6] qapi: add SysEmuTarget to "common.json"
7711c0
Bugzilla: 1607406
7711c0
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
7711c0
RH-Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7711c0
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
7711c0
7711c0
We'll soon need an enumeration type that lists all the softmmu targets
7711c0
that QEMU (the project) supports. Introduce @SysEmuTarget to
7711c0
"common.json".
7711c0
7711c0
The enum constant @x86_64 doesn't match the QAPI convention of preferring
7711c0
hyphen ("-") over underscore ("_"). This is intentional; the @SysEmuTarget
7711c0
constants are supposed to produce QEMU executable names when stringified
7711c0
and appended to the "qemu-system-" prefix. Put differently, the
7711c0
replacement text of the TARGET_NAME preprocessor macro must be possible to
7711c0
look up in the list of (stringified) enum constants.
7711c0
7711c0
Like other enum types, @SysEmuTarget too can be used for discriminator
7711c0
fields in unions. For the @i386 constant, a C-language union member called
7711c0
"i386" would be generated. On mingw build hosts, "i386" is a macro
7711c0
however. Add "i386" to "polluted_words" at once.
7711c0
7711c0
Cc: "Daniel P. Berrange" <berrange@redhat.com>
7711c0
Cc: Eric Blake <eblake@redhat.com>
7711c0
Cc: Markus Armbruster <armbru@redhat.com>
7711c0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
7711c0
Message-Id: <20180427192852.15013-3-lersek@redhat.com>
7711c0
Reviewed-by: Eric Blake <eblake@redhat.com>
7711c0
Reviewed-by: Markus Armbruster <armbru@redhat.com>
7711c0
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7711c0
(cherry picked from commit 9a801c7d6c8fd927df915f2ac3eacd306e8fc334)
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 qapi/common.json       | 23 +++++++++++++++++++++++
7711c0
 scripts/qapi/common.py |  2 +-
7711c0
 2 files changed, 24 insertions(+), 1 deletion(-)
7711c0
7711c0
diff --git a/qapi/common.json b/qapi/common.json
7711c0
index d9b14dd..c811d04 100644
7711c0
--- a/qapi/common.json
7711c0
+++ b/qapi/common.json
7711c0
@@ -126,3 +126,26 @@
7711c0
 ##
7711c0
 { 'enum': 'OffAutoPCIBAR',
7711c0
   'data': [ 'off', 'auto', 'bar0', 'bar1', 'bar2', 'bar3', 'bar4', 'bar5' ] }
7711c0
+
7711c0
+##
7711c0
+# @SysEmuTarget:
7711c0
+#
7711c0
+# The comprehensive enumeration of QEMU system emulation ("softmmu")
7711c0
+# targets. Run "./configure --help" in the project root directory, and
7711c0
+# look for the *-softmmu targets near the "--target-list" option. The
7711c0
+# individual target constants are not documented here, for the time
7711c0
+# being.
7711c0
+#
7711c0
+# Notes: The resulting QMP strings can be appended to the "qemu-system-"
7711c0
+#        prefix to produce the corresponding QEMU executable name. This
7711c0
+#        is true even for "qemu-system-x86_64".
7711c0
+#
7711c0
+# Since: 2.13
7711c0
+##
7711c0
+{ 'enum' : 'SysEmuTarget',
7711c0
+  'data' : [ 'aarch64', 'alpha', 'arm', 'cris', 'hppa', 'i386', 'lm32',
7711c0
+             'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
7711c0
+             'mips64el', 'mipsel', 'moxie', 'nios2', 'or1k', 'ppc',
7711c0
+             'ppc64', 'ppcemb', 'riscv32', 'riscv64', 's390x', 'sh4',
7711c0
+             'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32',
7711c0
+             'x86_64', 'xtensa', 'xtensaeb' ] }
7711c0
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
7711c0
index 3e14bc4..a032cec 100644
7711c0
--- a/scripts/qapi/common.py
7711c0
+++ b/scripts/qapi/common.py
7711c0
@@ -1822,7 +1822,7 @@ def c_name(name, protect=True):
7711c0
                      'and', 'and_eq', 'bitand', 'bitor', 'compl', 'not',
7711c0
                      'not_eq', 'or', 'or_eq', 'xor', 'xor_eq'])
7711c0
     # namespace pollution:
7711c0
-    polluted_words = set(['unix', 'errno', 'mips', 'sparc'])
7711c0
+    polluted_words = set(['unix', 'errno', 'mips', 'sparc', 'i386'])
7711c0
     name = name.translate(c_name_trans)
7711c0
     if protect and (name in c89_words | c99_words | c11_words | gcc_words
7711c0
                     | cpp_words | polluted_words):
7711c0
-- 
7711c0
1.8.3.1
7711c0