From nobody Fri Nov 7 03:40:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=listsout.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from listsout.gnu.org (listsout.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1546438783884486.10717821193407; Wed, 2 Jan 2019 06:19:43 -0800 (PST) Received: from localhost ([127.0.0.1]:45106 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gehN0-00056f-AE for importer@patchew.org; Wed, 02 Jan 2019 09:19:42 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gehJk-0002lO-Oh for qemu-devel@nongnu.org; Wed, 02 Jan 2019 09:16:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gehJf-0005nW-4j for qemu-devel@nongnu.org; Wed, 02 Jan 2019 09:16:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53546) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gehJa-0005jT-Q2 for qemu-devel@nongnu.org; Wed, 02 Jan 2019 09:16:11 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CBAEC7BDBF; Wed, 2 Jan 2019 14:16:06 +0000 (UTC) Received: from thinkpad.redhat.com (ovpn-204-113.brq.redhat.com [10.40.204.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D7E75D9C5; Wed, 2 Jan 2019 14:16:04 +0000 (UTC) From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 2 Jan 2019 15:16:03 +0100 Message-Id: <20190102141603.3681-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 02 Jan 2019 14:16:06 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] cpus: ignore ESRCH in qemu_cpu_kick_thread() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Peter Crosthwaite , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We can have a race condition between qemu_cpu_kick_thread() and qemu_kvm_cpu_thread_fn() when we hotunplug a CPU. In this case, qemu_cpu_kick_thread() can try to kick a thread that is exiting. pthread_kill() returns an error and qemu is stopped by an exit(1). qemu:qemu_cpu_kick_thread: No such process We can ignore safely this error. Signed-off-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- cpus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpus.c b/cpus.c index 0ddeeefc14..4717490bd0 100644 --- a/cpus.c +++ b/cpus.c @@ -1778,7 +1778,7 @@ static void qemu_cpu_kick_thread(CPUState *cpu) } cpu->thread_kicked =3D true; err =3D pthread_kill(cpu->thread->thread, SIG_IPI); - if (err) { + if (err && err !=3D ESRCH) { fprintf(stderr, "qemu:%s: %s", __func__, strerror(err)); exit(1); } --=20 2.20.1