From 0acd85e553d371b86b5c387f23301947329fdcf3 Mon Sep 17 00:00:00 2001 From: Zhenyu Zheng Date: Thu, 24 Sep 2020 22:12:21 +0800 Subject: [PATCH] cpu: Modify virCPUarmCompare to perform compare actions Modify virCPUarmCompare in cpu_arm.c to perform compare action. This patch only adds host to host CPU compare, the rest cases remains the same. This is useful for source and destination host compare during migrations to avoid migration between different CPU models that have different CPU freatures. ------------------------------------------------------------- This patch only adds host to host CPU compare, the rest cases remains the same. Signed-off-by: Zhenyu Zheng Signed-off-by: Michal Privoznik Reviewed-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik Signed-off-by: pengmengguang Conflicts: [pengmengguang: adjust content] Signed-off-by: Jiakun Shuai --- src/cpu/cpu_arm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index a0c0befaa0..b2b2d90a40 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -979,6 +979,10 @@ virCPUarmCompare(virCPUDefPtr host, virCPUCompareResult ret = VIR_CPU_COMPARE_ERROR; g_autofree char *message = NULL; + /* Only support host to host CPU compare for ARM */ + if (cpu->type != VIR_CPU_TYPE_HOST) + return VIR_CPU_COMPARE_IDENTICAL; + if (!host || !host->model) { if (failMessages) { virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s", -- 2.41.0.windows.1