qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: linzhecheng <linzhecheng@huawei.com>
Cc: qemu-devel@nongnu.org, xuyandong2@huawei.com,
	pbonzini@redhat.com, wangxinxin.wang@huawei.com, rth@twiddle.net,
	crosthwaite.peter@gmail.com
Subject: Re: [Qemu-devel] [PATCH] cpu: skip unpluged cpu when querying cpus
Date: Wed, 11 Apr 2018 13:46:00 +0200	[thread overview]
Message-ID: <20180411134600.0ed8158a@redhat.com> (raw)
In-Reply-To: <20180411111602.20156-1-linzhecheng@huawei.com>

On Wed, 11 Apr 2018 19:16:02 +0800
linzhecheng <linzhecheng@huawei.com> wrote:

> From: XuYandong <xuyandong2@huawei.com>
> 
> 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 <xuyandong2@huawei.com>
> ---
>  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;

  reply	other threads:[~2018-04-11 11:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-11 11:16 [Qemu-devel] [PATCH] cpu: skip unpluged cpu when querying cpus linzhecheng
2018-04-11 11:46 ` Igor Mammedov [this message]
2018-04-13  7:27   ` xuyandong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180411134600.0ed8158a@redhat.com \
    --to=imammedo@redhat.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=linzhecheng@huawei.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=wangxinxin.wang@huawei.com \
    --cc=xuyandong2@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).