提交 6af5a062 编写于 作者: J Jiri Denemark

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.
上级 16c6b60c
...@@ -414,15 +414,14 @@ no_memory: ...@@ -414,15 +414,14 @@ no_memory:
} }
static virCPUCompareResult static virCPUCompareResult
PowerPCCompare(virCPUDefPtr host, ppcCompare(virCPUDefPtr host,
virCPUDefPtr cpu) virCPUDefPtr cpu)
{ {
if ((cpu->arch != VIR_ARCH_NONE && if ((cpu->arch == VIR_ARCH_NONE || host->arch == cpu->arch) &&
(host->arch != cpu->arch)) || STREQ(host->model, cpu->model))
STRNEQ(host->model, cpu->model)) return VIR_CPU_COMPARE_IDENTICAL;
return VIR_CPU_COMPARE_INCOMPATIBLE;
return VIR_CPU_COMPARE_IDENTICAL; return VIR_CPU_COMPARE_INCOMPATIBLE;
} }
static int static int
...@@ -631,7 +630,7 @@ struct cpuArchDriver cpuDriverPowerPC = { ...@@ -631,7 +630,7 @@ struct cpuArchDriver cpuDriverPowerPC = {
.name = "ppc64", .name = "ppc64",
.arch = archs, .arch = archs,
.narch = ARRAY_CARDINALITY(archs), .narch = ARRAY_CARDINALITY(archs),
.compare = PowerPCCompare, .compare = ppcCompare,
.decode = PowerPCDecode, .decode = PowerPCDecode,
.encode = NULL, .encode = NULL,
.free = PowerPCDataFree, .free = PowerPCDataFree,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册