From: Daniel Hansel Date: Fri, 19 Dec 2014 14:49:35 +0000 (+0100) Subject: cpu: Bugfix for s390 CPU driver to return a host CPU model X-Git-Tag: v1.2.12-rc1~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59403018893cf2c4f9a6f5145e387cefbd44399a;p=thirdparty%2Flibvirt.git cpu: Bugfix for s390 CPU driver to return a host CPU model The curent libvirt CPU driver for s390 does not return a host CPU model. This patch returns 'host' according to the other platforms that would not decode any CPU model. This is an intermediate bugfix due to a discussion on OpenStack mailing list. The final patch introducing the CPU model support for s390x will exchange the hard-coded decode method. Signed-off-by: Daniel Hansel --- diff --git a/src/cpu/cpu_s390.c b/src/cpu/cpu_s390.c index f9d7e216ae..23a7f9d8d3 100644 --- a/src/cpu/cpu_s390.c +++ b/src/cpu/cpu_s390.c @@ -25,6 +25,7 @@ #include #include "viralloc.h" +#include "virstring.h" #include "cpu.h" @@ -47,7 +48,7 @@ s390NodeData(virArch arch) static int -s390Decode(virCPUDefPtr cpu ATTRIBUTE_UNUSED, +s390Decode(virCPUDefPtr cpu, const virCPUData *data ATTRIBUTE_UNUSED, const char **models ATTRIBUTE_UNUSED, unsigned int nmodels ATTRIBUTE_UNUSED, @@ -57,6 +58,10 @@ s390Decode(virCPUDefPtr cpu ATTRIBUTE_UNUSED, virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES, -1); + if (cpu->model == NULL && + VIR_STRDUP(cpu->model, "host") < 0) + return -1; + return 0; }