[libvirt] [PATCH 2/2] S390: Enable the QMP query-cpu-definitions command

Viktor Mihajlovski mihajlov at linux.vnet.ibm.com
Tue Dec 4 17:54:31 UTC 2012


Since libvirt is using QMP for cpu definition probing, it is
beneficial to have a minimum implementation for that.
This covers only cpu model = host and needs to be reworked into
a full-fledged version later on.

Signed-off-by: Viktor Mihajlovski <mihajlov at linux.vnet.ibm.com>
---
 target-s390x/cpu.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c
index d0d9aa5..1370af5 100644
--- a/target-s390x/cpu.c
+++ b/target-s390x/cpu.c
@@ -25,6 +25,7 @@
 #include "sysemu.h"
 #include "qemu-common.h"
 #include "qemu-timer.h"
+#include "arch_init.h"
 
 #ifndef CONFIG_USER_ONLY
 #include "hw/s390x/sclp.h"
@@ -91,6 +92,20 @@ void s390_cpu_list(FILE *f, fprintf_function cpu_fprintf)
     (*cpu_fprintf)(f, "s390 %16s\n", "[host]");
 }
 
+CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
+{
+    CpuDefinitionInfoList *entry;
+    CpuDefinitionInfo *info;
+
+    info = g_malloc0(sizeof(*info));
+    info->name = g_strdup("host");
+
+    entry = g_malloc0(sizeof(*entry));
+    entry->value = info;
+
+    return entry;
+}
+
 /* CPUClass::reset() */
 static void s390_cpu_reset(CPUState *s)
 {
-- 
1.7.0.4




More information about the libvir-list mailing list