aboutsummaryrefslogtreecommitdiff
path: root/target-i386/cpu.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-08-10 11:04:14 -0500
committerLuiz Capitulino <lcapitulino@redhat.com>2012-08-13 16:10:19 -0300
commite3966126d077ef60997f651d8e42b71c623b44a6 (patch)
tree2359188499c0049799add5a7010ba0faee7c16ea /target-i386/cpu.c
parente4e31c6324af480a22bf4150266b278368eaa336 (diff)
downloadqemu-e3966126d077ef60997f651d8e42b71c623b44a6.zip
qemu-e3966126d077ef60997f651d8e42b71c623b44a6.tar.gz
qemu-e3966126d077ef60997f651d8e42b71c623b44a6.tar.bz2
target-i386: add implementation of query-cpu-definitions (v2)
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'target-i386/cpu.c')
-rw-r--r--target-i386/cpu.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 880cfea..6d5d0d6 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -28,6 +28,7 @@
#include "qemu-config.h"
#include "qapi/qapi-visit-core.h"
+#include "qmp-commands.h"
#include "hyperv.h"
@@ -1125,6 +1126,27 @@ void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
}
}
+CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp)
+{
+ CpuDefinitionInfoList *cpu_list = NULL;
+ x86_def_t *def;
+
+ for (def = x86_defs; def; def = def->next) {
+ CpuDefinitionInfoList *entry;
+ CpuDefinitionInfo *info;
+
+ info = g_malloc0(sizeof(*info));
+ info->name = g_strdup(def->name);
+
+ entry = g_malloc0(sizeof(*entry));
+ entry->value = info;
+ entry->next = cpu_list;
+ cpu_list = entry;
+ }
+
+ return cpu_list;
+}
+
int cpu_x86_register(X86CPU *cpu, const char *cpu_model)
{
CPUX86State *env = &cpu->env;