From: Anthony Liguori Date: Fri, 10 Aug 2012 16:04:13 +0000 (-0500) Subject: qapi: add query-cpu-definitions command (v2) X-Git-Tag: qemu-xen-4.3.0-rc1~745^2~2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e4e31c6324af480a22bf4150266b278368eaa336;p=qemu-upstream-4.5-testing.git qapi: add query-cpu-definitions command (v2) 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 Signed-off-by: Luiz Capitulino --- diff --git a/qapi-schema.json b/qapi-schema.json index e51753cdb..9347b6a49 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 fd8777546..521da1055 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 254a32fd7..6c1e4e897 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; +}