From: Jiri Denemark Date: Thu, 12 Jul 2012 09:49:15 +0000 (+0200) Subject: qemu: Do not fail virConnectCompareCPU if host CPU is not known X-Git-Tag: CVE-2012-3445~163 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87c8623161f19c4f37844991deb1477e53c2b310;p=thirdparty%2Flibvirt.git qemu: Do not fail virConnectCompareCPU if host CPU is not known When host CPU could not be properly detected, virConnectCompareCPU will just report that any CPU is incompatible with host CPU instead of failing. --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 29ebb4c540..451159abd8 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9423,9 +9423,12 @@ qemuCPUCompare(virConnectPtr conn, qemuDriverLock(driver); - if (!driver->caps || !driver->caps->host.cpu) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("cannot get host CPU capabilities")); + if (!driver->caps) { + qemuReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("cannot get host capabilities")); + } else if (!driver->caps->host.cpu) { + VIR_WARN("cannot get host CPU capabilities"); + ret = VIR_CPU_COMPARE_INCOMPATIBLE; } else { ret = cpuCompareXML(driver->caps->host.cpu, xmlDesc); }