[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 46/48] qapi: add query-cpu-definitions command (v2)
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 46/48] qapi: add query-cpu-definitions command (v2) |
Date: |
Mon, 13 Aug 2012 16:49:07 -0300 |
From: Anthony Liguori <address@hidden>
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>
Signed-off-by: Luiz Capitulino <address@hidden>
---
qapi-schema.json | 23 +++++++++++++++++++++++
qmp-commands.hx | 6 ++++++
qmp.c | 6 ++++++
3 files changed, 35 insertions(+)
diff --git a/qapi-schema.json b/qapi-schema.json
index e51753c..9347b6a 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -2222,3 +2222,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 fd87775..521da10 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.11.2.249.g31c7954.dirty
- [Qemu-devel] [PATCH 21/48] qapi: don't convert enum strings to lowercase, (continued)
- [Qemu-devel] [PATCH 21/48] qapi: don't convert enum strings to lowercase, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 25/48] qerror: add proper ErrorClass value for QERR_ macros, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 48/48] target-ppc: add implementation of query-cpu-definitions (v2), Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 24/48] error, qerror: add ErrorClass argument to error functions, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 47/48] target-i386: add implementation of query-cpu-definitions (v2), Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 31/48] error: drop error_get_qobject()/error_set_qobject(), Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 27/48] hmp: hmp_change(): use error_get_class(), Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 30/48] qemu-ga: switch to the new error format on the wire, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 41/48] qmp: add SUSPEND_DISK event, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 23/48] qerror: qerror_table: don't use C99 struct initializers, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 46/48] qapi: add query-cpu-definitions command (v2),
Luiz Capitulino <=
- [Qemu-devel] [PATCH 39/48] qmp: qmp-events.txt: put events in alphabetical order, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 40/48] qmp: qmp-events.txt: add missing doc for the SUSPEND event, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 32/48] error, qerror: pass desc string to error calls, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 45/48] compiler: add macro for GCC weak symbols, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 44/48] qapi: add query-machines command, Luiz Capitulino, 2012/08/13
- Re: [Qemu-devel] [PULL 00/48]: QMP queue, Anthony Liguori, 2012/08/13