[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 49/50] qapi: make query-cpu-model-expansion depen
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH v3 49/50] qapi: make query-cpu-model-expansion depend on s390 or x86 |
Date: |
Mon, 11 Sep 2017 13:06:22 +0200 |
Signed-off-by: Marc-André Lureau <address@hidden>
---
qapi-schema.json | 38 ---------------------------------
qapi/target.json | 39 ++++++++++++++++++++++++++++++++++
include/sysemu/arch_init.h | 3 ---
monitor.c | 3 ---
qmp.c | 7 ------
stubs/arch-query-cpu-model-expansion.c | 12 -----------
target/i386/cpu.c | 3 ++-
target/s390x/cpu_models.c | 2 +-
stubs/Makefile.objs | 1 -
9 files changed, 42 insertions(+), 66 deletions(-)
delete mode 100644 stubs/arch-query-cpu-model-expansion.c
diff --git a/qapi-schema.json b/qapi-schema.json
index 23151506e7..98525c7702 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -2020,44 +2020,6 @@
'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 daf4bfa8f1..d9f3bce22f 100644
--- a/qapi/target.json
+++ b/qapi/target.json
@@ -175,3 +175,42 @@
##
{ 'command': 'query-gic-capabilities', 'returns': ['GICCapability'],
'if': 'defined(TARGET_ARM)' }
+
+##
+# @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/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
index f193f5189b..08a607b89b 100644
--- a/include/sysemu/arch_init.h
+++ b/include/sysemu/arch_init.h
@@ -32,7 +32,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 acf4721b30..24680f37a6 100644
--- a/monitor.c
+++ b/monitor.c
@@ -971,9 +971,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/qmp.c b/qmp.c
index 7b6861846f..afa266ec1e 100644
--- a/qmp.c
+++ b/qmp.c
@@ -546,13 +546,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/arch-query-cpu-model-expansion.c
b/stubs/arch-query-cpu-model-expansion.c
deleted file mode 100644
index ae7cf554d1..0000000000
--- a/stubs/arch-query-cpu-model-expansion.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "qemu/osdep.h"
-#include "qemu-common.h"
-#include "sysemu/arch_init.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 69676e13e1..f8719cb2de 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -36,6 +36,7 @@
#include "qapi/visitor.h"
#include "qom/qom-qobject.h"
#include "sysemu/arch_init.h"
+#include "target-qmp-commands.h"
#if defined(CONFIG_KVM)
#include <linux/kvm_para.h>
@@ -2618,7 +2619,7 @@ out:
}
CpuModelExpansionInfo *
-arch_query_cpu_model_expansion(CpuModelExpansionType type,
+qmp_query_cpu_model_expansion(CpuModelExpansionType type,
CpuModelInfo *model,
Error **errp)
{
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index 5f8151925a..872dc78455 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -524,7 +524,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)
{
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index 5419f0f995..8d024a2b71 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
--
2.14.1.146.gd35faa819
- [Qemu-devel] [PATCH v3 41/50] qapi: add a 'unit' pragma, (continued)
- [Qemu-devel] [PATCH v3 41/50] qapi: add a 'unit' pragma, Marc-André Lureau, 2017/09/11
- [Qemu-devel] [PATCH v3 40/50] qapi: add -i/--include filename.h, Marc-André Lureau, 2017/09/11
- [Qemu-devel] [PATCH v3 42/50] qapi: add a -u/--unit option to specify which unit to visit, Marc-André Lureau, 2017/09/11
- [Qemu-devel] [PATCH v3 44/50] build-sys: add a target schema, Marc-André Lureau, 2017/09/11
- [Qemu-devel] [PATCH v3 43/50] build-sys: move qmp-introspect per target, Marc-André Lureau, 2017/09/11
- [Qemu-devel] [PATCH v3 45/50] qapi: make rtc-reset-reinjection depend on TARGET_I386, Marc-André Lureau, 2017/09/11
- [Qemu-devel] [PATCH v3 47/50] target.json: add a note about query-cpu* not being s390x-specific, Marc-André Lureau, 2017/09/11
- [Qemu-devel] [PATCH v3 46/50] qapi: make s390 commands depend on TARGET_S390X, Marc-André Lureau, 2017/09/11
- [Qemu-devel] [PATCH v3 49/50] qapi: make query-cpu-model-expansion depend on s390 or x86,
Marc-André Lureau <=
- [Qemu-devel] [PATCH v3 48/50] qapi: make query-gic-capabilities depend on TARGET_ARM, Marc-André Lureau, 2017/09/11
- [Qemu-devel] [PATCH v3 50/50] qapi: make query-cpu-definitions depend on specific targets, Marc-André Lureau, 2017/09/11
- Re: [Qemu-devel] [PATCH v3 00/50] Hi,, no-reply, 2017/09/11