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

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