[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/7] qapi: add query-cpu-definitions command (v2)
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 5/7] qapi: add query-cpu-definitions command (v2) |
Date: |
Fri, 10 Aug 2012 11:04:13 -0500 |
This command attempts to map to the behavior of -cpu ?. Unfortunately, the
output of this command differs wildly across targets.
To accommodate this, we use a weak symbol to implement a default version of the
command that fails with a QERR_NOT_SUPPORTED error code. Targets can then
override and implement this command if it makes sense for them.
Signed-off-by: Anthony Liguori <address@hidden>
---
v1 -> v2
- rename query-cpudefs -> query-cpu-definitions
---
qapi-schema.json | 23 +++++++++++++++++++++++
qmp-commands.hx | 6 ++++++
qmp.c | 6 ++++++
3 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/qapi-schema.json b/qapi-schema.json
index 1eb0b0f..f1da7ee 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -2244,3 +2244,26 @@
# Since: 1.2.0
##
{ 'command': 'query-machines', 'returns': ['MachineInfo'] }
+
+##
+# @CpuDefinitionInfo:
+#
+# Virtual CPU definition.
+#
+# @name: the name of the CPU definition
+#
+# Since: 1.2.0
+##
+{ 'type': 'CpuDefinitionInfo',
+ 'data': { 'name': 'str' } }
+
+##
+# @query-cpu-definitions:
+#
+# Return a list of supported virtual CPU definitions
+#
+# Returns: a list of CpuDefInfo
+#
+# Since: 1.2.0
+##
+{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
diff --git a/qmp-commands.hx b/qmp-commands.hx
index f343772..4da2b86 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -2230,3 +2230,9 @@ EQMP
.mhandler.cmd_new = qmp_marshal_input_query_machines,
},
+ {
+ .name = "query-cpu-definitions",
+ .args_type = "",
+ .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
+ },
+
diff --git a/qmp.c b/qmp.c
index 254a32f..6c1e4e8 100644
--- a/qmp.c
+++ b/qmp.c
@@ -467,3 +467,9 @@ DevicePropertyInfoList *qmp_device_list_properties(const
char *typename,
return prop_list;
}
+
+CpuDefinitionInfoList GCC_WEAK *qmp_query_cpu_definitions(Error **errp)
+{
+ error_set(errp, QERR_NOT_SUPPORTED);
+ return NULL;
+}
--
1.7.5.4
- [Qemu-devel] [PATCH 0/7] qapi: add commands to remove the need (v2), Anthony Liguori, 2012/08/10
- [Qemu-devel] [PATCH 4/7] compiler: add macro for GCC weak symbols, Anthony Liguori, 2012/08/10
- [Qemu-devel] [PATCH 6/7] target-i386: add implementation of query-cpu-definitions (v2), Anthony Liguori, 2012/08/10
- [Qemu-devel] [PATCH 7/7] target-ppc: add implementation of query-cpu-definitions (v2), Anthony Liguori, 2012/08/10
- [Qemu-devel] [PATCH 2/7] qapi: mark QOM commands stable, Anthony Liguori, 2012/08/10
- [Qemu-devel] [PATCH 5/7] qapi: add query-cpu-definitions command (v2),
Anthony Liguori <=
- [Qemu-devel] [PATCH 1/7] qmp: introduce device-list-properties command, Anthony Liguori, 2012/08/10
- [Qemu-devel] [PATCH 3/7] qapi: add query-machines command, Anthony Liguori, 2012/08/10
- Re: [Qemu-devel] [PATCH 0/7] qapi: add commands to remove the need (v2), Luiz Capitulino, 2012/08/13