Don't ignore guest CPU selection when unsupported by HV

When qemu libvirt driver doesn't support guest CPU selection with given
qemu binary, guests requiring specific CPU should fail to start instead
of being silently supplied with a default CPU.
This commit is contained in:
Jiri Denemark 2010-04-06 16:26:36 +02:00
parent 6c5450646c
commit f599156641
1 changed files with 10 additions and 3 deletions

View File

@ -3249,9 +3249,16 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver,
virBuffer buf = VIR_BUFFER_INITIALIZER;
int i;
if (def->cpu && def->cpu->model
&& qemudProbeCPUModels(emulator, ut->machine, &ncpus, &cpus) < 0)
goto cleanup;
if (def->cpu && def->cpu->model) {
if (qemudProbeCPUModels(emulator, ut->machine, &ncpus, &cpus) < 0)
goto cleanup;
if (!ncpus || !host) {
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
_("CPU specification not supported by hypervisor"));
goto cleanup;
}
}
if (ncpus > 0 && host) {
virCPUCompareResult cmp;