On 05/07/2014 12:38 PM, Oleg Strikov wrote:
Libvirt calls cpuArchDriver.compare() while doing guest migration.
We don't have any logic to distinguish between different arm and
aarch64 models that's why this patch allows migration to any host.
Signed-off-by: Oleg Strikov <oleg.strikov(a)canonical.com>
---
src/cpu/cpu_aarch64.c | 9 ++++++++-
src/cpu/cpu_arm.c | 9 ++++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/cpu/cpu_aarch64.c b/src/cpu/cpu_aarch64.c
index 3c3e749..7255d9f 100644
--- a/src/cpu/cpu_aarch64.c
+++ b/src/cpu/cpu_aarch64.c
@@ -108,11 +108,18 @@ AArch64Baseline(virCPUDefPtr *cpus,
return cpu;
}
+static virCPUCompareResult
+AArch64Compare(virCPUDefPtr host ATTRIBUTE_UNUSED,
+ virCPUDefPtr cpu ATTRIBUTE_UNUSED)
+{
+ return VIR_CPU_COMPARE_IDENTICAL;
+}
+
struct cpuArchDriver cpuDriverAARCH64 = {
.name = "aarch64",
.arch = archs,
.narch = ARRAY_CARDINALITY(archs),
- .compare = NULL,
+ .compare = AArch64Compare,
.decode = AArch64Decode,
.encode = NULL,
.free = AArch64DataFree,
diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c
index ec80b35..53bf4f4 100644
--- a/src/cpu/cpu_arm.c
+++ b/src/cpu/cpu_arm.c
@@ -109,11 +109,18 @@ ArmBaseline(virCPUDefPtr *cpus,
return cpu;
}
+static virCPUCompareResult
+ArmCompare(virCPUDefPtr host ATTRIBUTE_UNUSED,
+ virCPUDefPtr cpu ATTRIBUTE_UNUSED)
+{
+ return VIR_CPU_COMPARE_IDENTICAL;
+}
+
struct cpuArchDriver cpuDriverArm = {
.name = "arm",
.arch = archs,
.narch = ARRAY_CARDINALITY(archs),
- .compare = NULL,
+ .compare = ArmCompare,
.decode = ArmDecode,
.encode = NULL,
.free = ArmDataFree,
ACK and pushed
- Cole