[libvirt] [PATCH 0/2] CPU Probing Revisited

I have not yet given up on the CPU probing. Since the orginal patch was not well received w.r.t error checking I have effectively undone the cpu model checking part. Next, I have enabled the QMP query-cpu-definitions command in a minimalistic fashion, return host as the only supported CPU model. The patch works in so far that I can see the result flowing back to libvirt. Unfortunately libvirt seems to choke on what it gets, but I will follow up on this seperately, probably just another libvirt QMP hickup... Viktor Mihajlovski (2): S390: Undo the cpu model checking. S390: Enable the QMP query-cpu-definitions command hw/s390-virtio.c | 5 ----- target-s390x/cpu.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-)

As the host model checking prompted some controversies we will abstain until a comprehensive CPU model handling has been established. Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> --- hw/s390-virtio.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c index 0f10114..b617468 100644 --- a/hw/s390-virtio.c +++ b/hw/s390-virtio.c @@ -199,11 +199,6 @@ static CPUS390XState *s390_init_cpus(const char *cpu_model, cpu_model = "host"; } - if (strcmp(cpu_model, "host")) { - fprintf(stderr, "S390 only supports host CPU model\n"); - exit(1); - } - /* * The maximum # of configurable CPU is 64, which is limited by Linux * kernel. Pre-allocate 64 S390CPU entries in ipi_states. -- 1.7.0.4

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@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

On Tue, Dec 04, 2012 at 06:54:29PM +0100, Viktor Mihajlovski wrote:
I have not yet given up on the CPU probing. Since the orginal patch was not well received w.r.t error checking I have effectively undone the cpu model checking part. Next, I have enabled the QMP query-cpu-definitions command in a minimalistic fashion, return host as the only supported CPU model.
The patch works in so far that I can see the result flowing back to libvirt. Unfortunately libvirt seems to choke on what it gets, but I will follow up on this seperately, probably just another libvirt QMP hickup...
Viktor Mihajlovski (2): S390: Undo the cpu model checking. S390: Enable the QMP query-cpu-definitions command
hw/s390-virtio.c | 5 ----- target-s390x/cpu.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-)
I believe you mean to send these to qemu-devel, rather than libvir-list REgards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (2)
-
Daniel P. Berrange
-
Viktor Mihajlovski