{"id":812348,"url":"http://patchwork.ozlabs.org/api/patches/812348/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170911110623.24981-50-marcandre.lureau@redhat.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170911110623.24981-50-marcandre.lureau@redhat.com>","list_archive_url":null,"date":"2017-09-11T11:06:22","name":"[v3,49/50] qapi: make query-cpu-model-expansion depend on s390 or x86","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"c8f1fbed3ed6e7626620f2bd85e62e02eb3833e5","submitter":{"id":66774,"url":"http://patchwork.ozlabs.org/api/people/66774/?format=json","name":"Marc-André Lureau","email":"marcandre.lureau@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170911110623.24981-50-marcandre.lureau@redhat.com/mbox/","series":[{"id":2480,"url":"http://patchwork.ozlabs.org/api/series/2480/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=2480","date":"2017-09-11T11:05:33","name":"Hi,","version":3,"mbox":"http://patchwork.ozlabs.org/series/2480/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/812348/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/812348/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=marcandre.lureau@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xrQk36fSqz9sBd\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 11 Sep 2017 21:31:39 +1000 (AEST)","from localhost ([::1]:56851 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drMwD-0001gx-Uc\n\tfor incoming@patchwork.ozlabs.org; Mon, 11 Sep 2017 07:31:37 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:43934)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <marcandre.lureau@redhat.com>) id 1drMaF-00070t-1g\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 07:08:59 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <marcandre.lureau@redhat.com>) id 1drMaD-0007bE-I0\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 07:08:54 -0400","from mx1.redhat.com ([209.132.183.28]:51282)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <marcandre.lureau@redhat.com>)\n\tid 1drMaD-0007af-9Q\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 07:08:53 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 3E318234A56;\n\tMon, 11 Sep 2017 11:08:52 +0000 (UTC)","from localhost (ovpn-112-47.ams2.redhat.com [10.36.112.47])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id D93016EC83;\n\tMon, 11 Sep 2017 11:08:49 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 3E318234A56","From":"=?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>","To":"qemu-devel@nongnu.org","Date":"Mon, 11 Sep 2017 13:06:22 +0200","Message-Id":"<20170911110623.24981-50-marcandre.lureau@redhat.com>","In-Reply-To":"<20170911110623.24981-1-marcandre.lureau@redhat.com>","References":"<20170911110623.24981-1-marcandre.lureau@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tMon, 11 Sep 2017 11:08:52 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"[Qemu-devel] [PATCH v3 49/50] qapi: make query-cpu-model-expansion\n\tdepend on s390 or x86","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Alexander Graf <agraf@suse.de>, Eduardo Habkost <ehabkost@redhat.com>,\n\tarmbru@redhat.com, \"Dr. David Alan Gilbert\" <dgilbert@redhat.com>, \n\tPaolo Bonzini <pbonzini@redhat.com>, =?utf-8?q?Marc-Andr=C3=A9_Lureau?=\n\t<marcandre.lureau@redhat.com>, \tRichard Henderson <rth@twiddle.net>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n---\n qapi-schema.json                       | 38 ---------------------------------\n qapi/target.json                       | 39 ++++++++++++++++++++++++++++++++++\n include/sysemu/arch_init.h             |  3 ---\n monitor.c                              |  3 ---\n qmp.c                                  |  7 ------\n stubs/arch-query-cpu-model-expansion.c | 12 -----------\n target/i386/cpu.c                      |  3 ++-\n target/s390x/cpu_models.c              |  2 +-\n stubs/Makefile.objs                    |  1 -\n 9 files changed, 42 insertions(+), 66 deletions(-)\n delete mode 100644 stubs/arch-query-cpu-model-expansion.c","diff":"diff --git a/qapi-schema.json b/qapi-schema.json\nindex 23151506e7..98525c7702 100644\n--- a/qapi-schema.json\n+++ b/qapi-schema.json\n@@ -2020,44 +2020,6 @@\n   'data': { 'model': 'CpuModelInfo' } }\n \n \n-##\n-# @query-cpu-model-expansion:\n-#\n-# Expands a given CPU model (or a combination of CPU model + additional options)\n-# to different granularities, allowing tooling to get an understanding what a\n-# specific CPU model looks like in QEMU under a certain configuration.\n-#\n-# This interface can be used to query the \"host\" CPU model.\n-#\n-# The data returned by this command may be affected by:\n-#\n-# * QEMU version: CPU models may look different depending on the QEMU version.\n-#   (Except for CPU models reported as \"static\" in query-cpu-definitions.)\n-# * machine-type: CPU model  may look different depending on the machine-type.\n-#   (Except for CPU models reported as \"static\" in query-cpu-definitions.)\n-# * machine options (including accelerator): in some architectures, CPU models\n-#   may look different depending on machine and accelerator options. (Except for\n-#   CPU models reported as \"static\" in query-cpu-definitions.)\n-# * \"-cpu\" arguments and global properties: arguments to the -cpu option and\n-#   global properties may affect expansion of CPU models. Using\n-#   query-cpu-model-expansion while using these is not advised.\n-#\n-# Some architectures may not support all expansion types. s390x supports\n-# \"full\" and \"static\".\n-#\n-# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is\n-#          not supported, if the model cannot be expanded, if the model contains\n-#          an unknown CPU definition name, unknown properties or properties\n-#          with a wrong type. Also returns an error if an expansion type is\n-#          not supported.\n-#\n-# Since: 2.8.0\n-##\n-{ 'command': 'query-cpu-model-expansion',\n-  'data': { 'type': 'CpuModelExpansionType',\n-            'model': 'CpuModelInfo' },\n-  'returns': 'CpuModelExpansionInfo' }\n-\n ##\n # @CpuModelCompareResult:\n #\ndiff --git a/qapi/target.json b/qapi/target.json\nindex daf4bfa8f1..d9f3bce22f 100644\n--- a/qapi/target.json\n+++ b/qapi/target.json\n@@ -175,3 +175,42 @@\n ##\n { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'],\n   'if': 'defined(TARGET_ARM)' }\n+\n+##\n+# @query-cpu-model-expansion:\n+#\n+# Expands a given CPU model (or a combination of CPU model + additional options)\n+# to different granularities, allowing tooling to get an understanding what a\n+# specific CPU model looks like in QEMU under a certain configuration.\n+#\n+# This interface can be used to query the \"host\" CPU model.\n+#\n+# The data returned by this command may be affected by:\n+#\n+# * QEMU version: CPU models may look different depending on the QEMU version.\n+#   (Except for CPU models reported as \"static\" in query-cpu-definitions.)\n+# * machine-type: CPU model  may look different depending on the machine-type.\n+#   (Except for CPU models reported as \"static\" in query-cpu-definitions.)\n+# * machine options (including accelerator): in some architectures, CPU models\n+#   may look different depending on machine and accelerator options. (Except for\n+#   CPU models reported as \"static\" in query-cpu-definitions.)\n+# * \"-cpu\" arguments and global properties: arguments to the -cpu option and\n+#   global properties may affect expansion of CPU models. Using\n+#   query-cpu-model-expansion while using these is not advised.\n+#\n+# Some architectures may not support all expansion types. s390x supports\n+# \"full\" and \"static\".\n+#\n+# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is\n+#          not supported, if the model cannot be expanded, if the model contains\n+#          an unknown CPU definition name, unknown properties or properties\n+#          with a wrong type. Also returns an error if an expansion type is\n+#          not supported.\n+#\n+# Since: 2.8.0\n+##\n+{ 'command': 'query-cpu-model-expansion',\n+  'data': { 'type': 'CpuModelExpansionType',\n+            'model': 'CpuModelInfo' },\n+  'returns': 'CpuModelExpansionInfo',\n+  'if': 'defined(TARGET_S390X) || defined(TARGET_I386)' }\ndiff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h\nindex f193f5189b..08a607b89b 100644\n--- a/include/sysemu/arch_init.h\n+++ b/include/sysemu/arch_init.h\n@@ -32,7 +32,4 @@ int kvm_available(void);\n int xen_available(void);\n \n CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp);\n-CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type,\n-                                                      CpuModelInfo *mode,\n-                                                      Error **errp);\n #endif\ndiff --git a/monitor.c b/monitor.c\nindex acf4721b30..24680f37a6 100644\n--- a/monitor.c\n+++ b/monitor.c\n@@ -971,9 +971,6 @@ static void qmp_query_qmp_schema(QDict *qdict, QObject **ret_data,\n  */\n static void qmp_unregister_commands_hack(void)\n {\n-#if !defined(TARGET_S390X) && !defined(TARGET_I386)\n-    qmp_unregister_command(&qmp_commands, \"query-cpu-model-expansion\");\n-#endif\n #if !defined(TARGET_PPC) && !defined(TARGET_ARM) && !defined(TARGET_I386) \\\n     && !defined(TARGET_S390X)\n     qmp_unregister_command(&qmp_commands, \"query-cpu-definitions\");\ndiff --git a/qmp.c b/qmp.c\nindex 7b6861846f..afa266ec1e 100644\n--- a/qmp.c\n+++ b/qmp.c\n@@ -546,13 +546,6 @@ CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp)\n     return arch_query_cpu_definitions(errp);\n }\n \n-CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,\n-                                                     CpuModelInfo *model,\n-                                                     Error **errp)\n-{\n-    return arch_query_cpu_model_expansion(type, model, errp);\n-}\n-\n void qmp_add_client(const char *protocol, const char *fdname,\n                     bool has_skipauth, bool skipauth, bool has_tls, bool tls,\n                     Error **errp)\ndiff --git a/stubs/arch-query-cpu-model-expansion.c b/stubs/arch-query-cpu-model-expansion.c\ndeleted file mode 100644\nindex ae7cf554d1..0000000000\n--- a/stubs/arch-query-cpu-model-expansion.c\n+++ /dev/null\n@@ -1,12 +0,0 @@\n-#include \"qemu/osdep.h\"\n-#include \"qemu-common.h\"\n-#include \"sysemu/arch_init.h\"\n-#include \"qapi/qmp/qerror.h\"\n-\n-CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type,\n-                                                      CpuModelInfo *mode,\n-                                                      Error **errp)\n-{\n-    error_setg(errp, QERR_UNSUPPORTED);\n-    return NULL;\n-}\ndiff --git a/target/i386/cpu.c b/target/i386/cpu.c\nindex 69676e13e1..f8719cb2de 100644\n--- a/target/i386/cpu.c\n+++ b/target/i386/cpu.c\n@@ -36,6 +36,7 @@\n #include \"qapi/visitor.h\"\n #include \"qom/qom-qobject.h\"\n #include \"sysemu/arch_init.h\"\n+#include \"target-qmp-commands.h\"\n \n #if defined(CONFIG_KVM)\n #include <linux/kvm_para.h>\n@@ -2618,7 +2619,7 @@ out:\n }\n \n CpuModelExpansionInfo *\n-arch_query_cpu_model_expansion(CpuModelExpansionType type,\n+qmp_query_cpu_model_expansion(CpuModelExpansionType type,\n                                                       CpuModelInfo *model,\n                                                       Error **errp)\n {\ndiff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c\nindex 5f8151925a..872dc78455 100644\n--- a/target/s390x/cpu_models.c\n+++ b/target/s390x/cpu_models.c\n@@ -524,7 +524,7 @@ static void cpu_info_from_model(CpuModelInfo *info, const S390CPUModel *model,\n     }\n }\n \n-CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type,\n+CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,\n                                                       CpuModelInfo *model,\n                                                       Error **errp)\n {\ndiff --git a/stubs/Makefile.objs b/stubs/Makefile.objs\nindex 5419f0f995..8d024a2b71 100644\n--- a/stubs/Makefile.objs\n+++ b/stubs/Makefile.objs\n@@ -1,5 +1,4 @@\n stub-obj-y += arch-query-cpu-def.o\n-stub-obj-y += arch-query-cpu-model-expansion.o\n stub-obj-y += bdrv-next-monitor-owned.o\n stub-obj-y += blk-commit-all.o\n stub-obj-y += blockdev-close-all-bdrv-states.o\n","prefixes":["v3","49/50"]}