All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com, eblake@redhat.com
Subject: [Qemu-devel] [PATCH v5 13/18] qapi: make query-cpu-model-expansion depend on s390 or x86
Date: Thu, 14 Feb 2019 16:22:46 +0100	[thread overview]
Message-ID: <20190214152251.2073-14-armbru@redhat.com> (raw)
In-Reply-To: <20190214152251.2073-1-armbru@redhat.com>

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/sysemu/arch_init.h             |  3 --
 monitor.c                              |  3 --
 qapi/misc.json                         | 51 -------------------------
 qapi/target.json                       | 52 ++++++++++++++++++++++++++
 qmp.c                                  |  7 ----
 stubs/Makefile.objs                    |  1 -
 stubs/arch-query-cpu-model-expansion.c | 13 -------
 target/i386/cpu.c                      |  5 ++-
 target/s390x/cpu_models.c              |  2 +-
 9 files changed, 57 insertions(+), 80 deletions(-)
 delete mode 100644 stubs/arch-query-cpu-model-expansion.c

diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
index f0ef652b2a..2497fd3351 100644
--- a/include/sysemu/arch_init.h
+++ b/include/sysemu/arch_init.h
@@ -33,7 +33,4 @@ int kvm_available(void);
 int xen_available(void);
 
 CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp);
-CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type,
-                                                      CpuModelInfo *mode,
-                                                      Error **errp);
 #endif
diff --git a/monitor.c b/monitor.c
index 33a0d81677..22a551b16b 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1145,9 +1145,6 @@ static void qmp_query_qmp_schema(QDict *qdict, QObject **ret_data,
  */
 static void qmp_unregister_commands_hack(void)
 {
-#if !defined(TARGET_S390X) && !defined(TARGET_I386)
-    qmp_unregister_command(&qmp_commands, "query-cpu-model-expansion");
-#endif
 #if !defined(TARGET_PPC) && !defined(TARGET_ARM) && !defined(TARGET_I386) \
     && !defined(TARGET_S390X)
     qmp_unregister_command(&qmp_commands, "query-cpu-definitions");
diff --git a/qapi/misc.json b/qapi/misc.json
index 9df45a27ca..1255201267 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -2199,57 +2199,6 @@
   'data': [ 'static', 'full' ] }
 
 
-##
-# @CpuModelExpansionInfo:
-#
-# The result of a cpu model expansion.
-#
-# @model: the expanded CpuModelInfo.
-#
-# Since: 2.8.0
-##
-{ 'struct': 'CpuModelExpansionInfo',
-  'data': { 'model': 'CpuModelInfo' } }
-
-
-##
-# @query-cpu-model-expansion:
-#
-# Expands a given CPU model (or a combination of CPU model + additional options)
-# to different granularities, allowing tooling to get an understanding what a
-# specific CPU model looks like in QEMU under a certain configuration.
-#
-# This interface can be used to query the "host" CPU model.
-#
-# The data returned by this command may be affected by:
-#
-# * QEMU version: CPU models may look different depending on the QEMU version.
-#   (Except for CPU models reported as "static" in query-cpu-definitions.)
-# * machine-type: CPU model  may look different depending on the machine-type.
-#   (Except for CPU models reported as "static" in query-cpu-definitions.)
-# * machine options (including accelerator): in some architectures, CPU models
-#   may look different depending on machine and accelerator options. (Except for
-#   CPU models reported as "static" in query-cpu-definitions.)
-# * "-cpu" arguments and global properties: arguments to the -cpu option and
-#   global properties may affect expansion of CPU models. Using
-#   query-cpu-model-expansion while using these is not advised.
-#
-# Some architectures may not support all expansion types. s390x supports
-# "full" and "static".
-#
-# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
-#          not supported, if the model cannot be expanded, if the model contains
-#          an unknown CPU definition name, unknown properties or properties
-#          with a wrong type. Also returns an error if an expansion type is
-#          not supported.
-#
-# Since: 2.8.0
-##
-{ 'command': 'query-cpu-model-expansion',
-  'data': { 'type': 'CpuModelExpansionType',
-            'model': 'CpuModelInfo' },
-  'returns': 'CpuModelExpansionInfo' }
-
 ##
 # @CpuModelCompareResult:
 #
diff --git a/qapi/target.json b/qapi/target.json
index f4a7054921..35653648bb 100644
--- a/qapi/target.json
+++ b/qapi/target.json
@@ -373,3 +373,55 @@
 ##
 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'],
   'if': 'defined(TARGET_ARM)' }
+
+##
+# @CpuModelExpansionInfo:
+#
+# The result of a cpu model expansion.
+#
+# @model: the expanded CpuModelInfo.
+#
+# Since: 2.8.0
+##
+{ 'struct': 'CpuModelExpansionInfo',
+  'data': { 'model': 'CpuModelInfo' },
+  'if': 'defined(TARGET_S390X) || defined(TARGET_I386)' }
+
+##
+# @query-cpu-model-expansion:
+#
+# Expands a given CPU model (or a combination of CPU model + additional options)
+# to different granularities, allowing tooling to get an understanding what a
+# specific CPU model looks like in QEMU under a certain configuration.
+#
+# This interface can be used to query the "host" CPU model.
+#
+# The data returned by this command may be affected by:
+#
+# * QEMU version: CPU models may look different depending on the QEMU version.
+#   (Except for CPU models reported as "static" in query-cpu-definitions.)
+# * machine-type: CPU model  may look different depending on the machine-type.
+#   (Except for CPU models reported as "static" in query-cpu-definitions.)
+# * machine options (including accelerator): in some architectures, CPU models
+#   may look different depending on machine and accelerator options. (Except for
+#   CPU models reported as "static" in query-cpu-definitions.)
+# * "-cpu" arguments and global properties: arguments to the -cpu option and
+#   global properties may affect expansion of CPU models. Using
+#   query-cpu-model-expansion while using these is not advised.
+#
+# Some architectures may not support all expansion types. s390x supports
+# "full" and "static".
+#
+# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
+#          not supported, if the model cannot be expanded, if the model contains
+#          an unknown CPU definition name, unknown properties or properties
+#          with a wrong type. Also returns an error if an expansion type is
+#          not supported.
+#
+# Since: 2.8.0
+##
+{ 'command': 'query-cpu-model-expansion',
+  'data': { 'type': 'CpuModelExpansionType',
+            'model': 'CpuModelInfo' },
+  'returns': 'CpuModelExpansionInfo',
+  'if': 'defined(TARGET_S390X) || defined(TARGET_I386)' }
diff --git a/qmp.c b/qmp.c
index 8a613bf7c7..c81af9d23f 100644
--- a/qmp.c
+++ b/qmp.c
@@ -610,13 +610,6 @@ CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp)
     return arch_query_cpu_definitions(errp);
 }
 
-CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
-                                                     CpuModelInfo *model,
-                                                     Error **errp)
-{
-    return arch_query_cpu_model_expansion(type, model, errp);
-}
-
 void qmp_add_client(const char *protocol, const char *fdname,
                     bool has_skipauth, bool skipauth, bool has_tls, bool tls,
                     Error **errp)
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index 8394a079d1..f337208179 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -1,5 +1,4 @@
 stub-obj-y += arch-query-cpu-def.o
-stub-obj-y += arch-query-cpu-model-expansion.o
 stub-obj-y += bdrv-next-monitor-owned.o
 stub-obj-y += blk-commit-all.o
 stub-obj-y += blockdev-close-all-bdrv-states.o
diff --git a/stubs/arch-query-cpu-model-expansion.c b/stubs/arch-query-cpu-model-expansion.c
deleted file mode 100644
index 26273a8b10..0000000000
--- a/stubs/arch-query-cpu-model-expansion.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "qemu/osdep.h"
-#include "qemu-common.h"
-#include "sysemu/arch_init.h"
-#include "qapi/error.h"
-#include "qapi/qmp/qerror.h"
-
-CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type,
-                                                      CpuModelInfo *mode,
-                                                      Error **errp)
-{
-    error_setg(errp, QERR_UNSUPPORTED);
-    return NULL;
-}
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index b077196611..aa3a1f3a4f 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -41,6 +41,7 @@
 #include "qapi/visitor.h"
 #include "qom/qom-qobject.h"
 #include "sysemu/arch_init.h"
+#include "qapi/qapi-commands-target.h"
 
 #include "standard-headers/asm-x86/kvm_para.h"
 
@@ -3918,6 +3919,7 @@ static void x86_cpu_load_def(X86CPU *cpu, X86CPUDefinition *def, Error **errp)
 
 }
 
+#ifndef CONFIG_USER_ONLY
 /* Return a QDict containing keys for all properties that can be included
  * in static expansion of CPU models. All properties set by x86_cpu_load_def()
  * must be included in the dictionary.
@@ -4065,7 +4067,7 @@ out:
 }
 
 CpuModelExpansionInfo *
-arch_query_cpu_model_expansion(CpuModelExpansionType type,
+qmp_query_cpu_model_expansion(CpuModelExpansionType type,
                                                       CpuModelInfo *model,
                                                       Error **errp)
 {
@@ -4120,6 +4122,7 @@ out:
     }
     return ret;
 }
+#endif  /* !CONFIG_USER_ONLY */
 
 static gchar *x86_gdb_arch_name(CPUState *cs)
 {
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index b532cd8d10..cf87488bfc 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -567,7 +567,7 @@ static void cpu_info_from_model(CpuModelInfo *info, const S390CPUModel *model,
     }
 }
 
-CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type,
+CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
                                                       CpuModelInfo *model,
                                                       Error **errp)
 {
-- 
2.17.2

  parent reply	other threads:[~2019-02-14 15:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 15:22 [Qemu-devel] [PATCH v5 00/18] qapi: add #if pre-processor conditions to generated code (part 3) Markus Armbruster
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 01/18] qapi: Belatedly document modular code generation Markus Armbruster
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 02/18] qapi: Fix up documentation for recent commit a95291007b2 Markus Armbruster
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 03/18] qapi: Clean up modular built-in code generation a bit Markus Armbruster
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 04/18] qapi: Prepare for system modules other than 'builtin' Markus Armbruster
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 05/18] qapi: Generate QAPIEvent stuff into separate files Markus Armbruster
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 06/18] build-sys: move qmp-introspect per target Markus Armbruster
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 07/18] build: Deal with all of QAPI's .o in qapi/Makefile.objs Markus Armbruster
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 08/18] qapi: New module target.json Markus Armbruster
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 09/18] qapi: make rtc-reset-reinjection and SEV depend on TARGET_I386 Markus Armbruster
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 10/18] qapi: make s390 commands depend on TARGET_S390X Markus Armbruster
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 11/18] target.json: add a note about query-cpu* not being s390x-specific Markus Armbruster
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 12/18] qapi: make query-gic-capabilities depend on TARGET_ARM Markus Armbruster
2019-02-14 15:22 ` Markus Armbruster [this message]
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 14/18] qapi: make query-cpu-definitions depend on specific targets Markus Armbruster
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 15/18] qapi: remove qmp_unregister_command() Markus Armbruster
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 16/18] Revert "qapi-events: add 'if' condition to implicit event enum" Markus Armbruster
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 17/18] qmp: Deprecate query-events in favor of query-qmp-schema Markus Armbruster
2019-02-14 15:22 ` [Qemu-devel] [PATCH v5 18/18] qapi: move RTC_CHANGE to the target schema Markus Armbruster
2019-02-14 15:24 ` [Qemu-devel] [PATCH v5 00/18] qapi: add #if pre-processor conditions to generated code (part 3) Markus Armbruster
2019-02-14 16:01   ` Eric Blake
2019-02-15  7:53     ` [Qemu-devel] Proper use of unnest-vars (was: [PATCH v5 00/18] qapi: add #if pre-processor conditions to generated code (part 3)) Markus Armbruster
2019-02-15  8:29       ` Paolo Bonzini
2019-02-15  9:26         ` [Qemu-devel] Proper use of unnest-vars Markus Armbruster

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=20190214152251.2073-14-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=marcandre.lureau@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.