mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
cpu: Make comparing PowerPC CPUs easier to read
Revert the condition to make it easier to read. The function is also renamed as ppcCompare to match other functions in PowerPC CPU driver.
This commit is contained in:
parent
16c6b60cbd
commit
6af5a06275
@ -414,15 +414,14 @@ no_memory:
|
||||
}
|
||||
|
||||
static virCPUCompareResult
|
||||
PowerPCCompare(virCPUDefPtr host,
|
||||
ppcCompare(virCPUDefPtr host,
|
||||
virCPUDefPtr cpu)
|
||||
{
|
||||
if ((cpu->arch != VIR_ARCH_NONE &&
|
||||
(host->arch != cpu->arch)) ||
|
||||
STRNEQ(host->model, cpu->model))
|
||||
return VIR_CPU_COMPARE_INCOMPATIBLE;
|
||||
if ((cpu->arch == VIR_ARCH_NONE || host->arch == cpu->arch) &&
|
||||
STREQ(host->model, cpu->model))
|
||||
return VIR_CPU_COMPARE_IDENTICAL;
|
||||
|
||||
return VIR_CPU_COMPARE_IDENTICAL;
|
||||
return VIR_CPU_COMPARE_INCOMPATIBLE;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -631,7 +630,7 @@ struct cpuArchDriver cpuDriverPowerPC = {
|
||||
.name = "ppc64",
|
||||
.arch = archs,
|
||||
.narch = ARRAY_CARDINALITY(archs),
|
||||
.compare = PowerPCCompare,
|
||||
.compare = ppcCompare,
|
||||
.decode = PowerPCDecode,
|
||||
.encode = NULL,
|
||||
.free = PowerPCDataFree,
|
||||
|
Loading…
Reference in New Issue
Block a user