qemu/arm-virt-Set-vcpus_count-of-CPU-as-1-to-compatible-w.patch

39 lines
1.3 KiB
Diff
Raw Permalink Normal View History

From 85d1711807bc1ec0118cdc9f7cbf9a6e6b96db76 Mon Sep 17 00:00:00 2001
From: Keqian Zhu <zhukeqian1@huawei.com>
Date: Thu, 23 May 2024 15:51:35 +0800
Subject: [PATCH] arm/virt: Set vcpus_count of CPU as 1 to compatible with
libvirt
If vcpus_count is greater than 1, use libvirt to hotplug vcpu
will fail: "An error occurred, but the cause is unknown".
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
---
hw/arm/virt.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index dfe4d9e129..a6e324c6f8 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -3064,7 +3064,6 @@ static const CPUArchIdList *virt_possible_cpu_arch_ids(MachineState *ms)
{
int n;
unsigned int max_cpus = ms->smp.max_cpus;
- unsigned int smp_threads = ms->smp.threads;
VirtMachineState *vms = VIRT_MACHINE(ms);
MachineClass *mc = MACHINE_GET_CLASS(vms);
@@ -3078,7 +3077,7 @@ static const CPUArchIdList *virt_possible_cpu_arch_ids(MachineState *ms)
ms->possible_cpus->len = max_cpus;
for (n = 0; n < ms->possible_cpus->len; n++) {
ms->possible_cpus->cpus[n].type = ms->cpu_type;
- ms->possible_cpus->cpus[n].vcpus_count = smp_threads;
+ ms->possible_cpus->cpus[n].vcpus_count = 1;
ms->possible_cpus->cpus[n].arch_id =
virt_cpu_mp_affinity(vms, n);
--
2.41.0.windows.1