mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
cpu: Never skip CPU model name check in ppc64 driver
ppc64Compute(), called by cpuNodeData(), is used not only to retrieve the driver-specific data associated to a guest CPU definition, but also to check whether said guest CPU is compatible with the host CPU. If the user is not interested in the CPU data, it's perfectly fine to pass a NULL pointer instead of a return location, and the compatibility data returned should not be affected by this. One of the checks, specifically the one on CPU model name, was however only performed if the return location was non-NULL.
This commit is contained in:
parent
e5ef51a4c0
commit
8382136d42
@ -407,26 +407,25 @@ ppc64Compute(virCPUDefPtr host,
|
|||||||
!(guest_model = ppc64ModelFromCPU(cpu, map)))
|
!(guest_model = ppc64ModelFromCPU(cpu, map)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (guestData) {
|
if (cpu->type == VIR_CPU_TYPE_GUEST &&
|
||||||
if (cpu->type == VIR_CPU_TYPE_GUEST &&
|
cpu->match == VIR_CPU_MATCH_STRICT &&
|
||||||
cpu->match == VIR_CPU_MATCH_STRICT &&
|
STRNEQ(guest_model->name, host_model->name)) {
|
||||||
STRNEQ(guest_model->name, host_model->name)) {
|
VIR_DEBUG("host CPU model does not match required CPU model %s",
|
||||||
VIR_DEBUG("host CPU model does not match required CPU model %s",
|
guest_model->name);
|
||||||
guest_model->name);
|
if (message &&
|
||||||
if (message &&
|
virAsprintf(message,
|
||||||
virAsprintf(message,
|
_("host CPU model does not match required "
|
||||||
_("host CPU model does not match required "
|
"CPU model %s"),
|
||||||
"CPU model %s"),
|
guest_model->name) < 0)
|
||||||
guest_model->name) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
ret = VIR_CPU_COMPARE_INCOMPATIBLE;
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
|
|
||||||
|
ret = VIR_CPU_COMPARE_INCOMPATIBLE;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (guestData)
|
||||||
if (!(*guestData = ppc64MakeCPUData(arch, &guest_model->data)))
|
if (!(*guestData = ppc64MakeCPUData(arch, &guest_model->data)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
|
|
||||||
ret = VIR_CPU_COMPARE_IDENTICAL;
|
ret = VIR_CPU_COMPARE_IDENTICAL;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user