[PATCH] qemu: Implement a stub cpuArchDriver.compare() handler for arm and aarch64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 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,
-- 
1.7.9.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]