[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] cpu: skip unpluged cpu when querying cpus
From: |
Igor Mammedov |
Subject: |
Re: [Qemu-devel] [PATCH] cpu: skip unpluged cpu when querying cpus |
Date: |
Wed, 11 Apr 2018 13:46:00 +0200 |
On Wed, 11 Apr 2018 19:16:02 +0800
linzhecheng <address@hidden> wrote:
> From: XuYandong <address@hidden>
>
> After vcpu1 thread exiting, vcpu0 thread (received notification) is still
> waiting for
> holding qemu_global_mutex in cpu_remove_sync, at this moment, vcpu1 is still
> in global cpus list.
> If main thread grab qemu_global_mutex in order to handle qmp command "info
> cpus",
> qmp_query_cpus visit unpluged vcpu1 will lead qemu process to exit.
Add here exact error or better stack trace in case it crashes.
> Signed-off-by: XuYandong <address@hidden>
> ---
> cpus.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/cpus.c b/cpus.c
> index 2cb0af9..9b3a6c4 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -2018,6 +2018,11 @@ CpuInfoList *qmp_query_cpus(Error **errp)
>
> CPU_FOREACH(cpu) {
> CpuInfoList *info;
> +
> + if (cpu->unplug) {
> + continue;
> + }
Shouldn't be it done for qmp_query_cpus_fast() as well?
> +
> #if defined(TARGET_I386)
> X86CPU *x86_cpu = X86_CPU(cpu);
> CPUX86State *env = &x86_cpu->env;