From nobody Mon Feb 9 22:20:03 2026 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=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; 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 lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549305714818647.6162789480395; Mon, 4 Feb 2019 10:41:54 -0800 (PST) Received: from localhost ([127.0.0.1]:47336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqjBj-0000Ut-Kt for importer@patchew.org; Mon, 04 Feb 2019 13:41:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqj6q-00051A-3r for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:36:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqj6p-0003Se-9o for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:36:43 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:37718) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gqj6n-0003NH-FF for qemu-devel@nongnu.org; Mon, 04 Feb 2019 13:36:41 -0500 Received: by mail-wr1-x429.google.com with SMTP id s12so969476wrt.4 for ; Mon, 04 Feb 2019 10:36:33 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s132sm8836236wmf.28.2019.02.04.10.36.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 10:36:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=CbQc0oVerUPwjt8sr54endkEDd1gxjnDLeM63jRNSVM=; b=DHRf+/DRKBXAagLO9eOvOqPMhk5GKo61SCaNNcPOVBppOuaNNEB8BkWsNSAXtK2O5z w/fcu/WKM58vI3JJIBv9ldog3Ku3Xrs2CAGhuaYgelkA0y7OI8zsi2dzeIXYYZw+m9fc xQYwzYYPHrYsIZ2isuCsZzh2yCR8YcbRlpWDs4E4Kf6//tgI2B2KRFUgx/a9XS2glm7t ED5hnYqy/5U2pUZAndS1ji1NmgMyixD//bYjWQKBfVALdcK6m40aYklyK0LxJ2DWjq8P Ep22oUeb3+AV2ypoXcld1fTM5G6EZeRRzET43oD4fjG5OWXK7/7YOBUaqRRnVgR48xa9 lm3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=CbQc0oVerUPwjt8sr54endkEDd1gxjnDLeM63jRNSVM=; b=W9Jr27dC8/V5K/sKjYVu0bsPWRrYe7DSnsj3pYgB/0BucNNLp2DkFKoWL/QUOHMjm2 w7vn9Q17VZ1eueZdAt/oyvbggu1eQhE8DSmTIz1uoaStZoTJVLSoyel4oPsTAtYllB6b EsyZns3iO833aJE4OgPrAytdnw/oRNtArr+wUnhFO6OtieI+ay3OLqHHZ7GfBgmToueW yR/o9fOnIUxnr327vP/P+aEVi+BtNyx6SP27Cyt6MzdqZBGkjwXHQyTH/jlcZhERjC9K n6ZREzUfOjg62gSYWt+g2jFYBFGpcIwzVvnYu2nr8ZrhzhMlnjeivKpyARAV1BZAN2kS uuzQ== X-Gm-Message-State: AHQUAua8Dm6ka7KDYjID+nHD46zmGMAqOM3mR+149xk88LHsH1MPADn8 K6kbm0IQuk6S7DL5IsFbEYt9B900 X-Google-Smtp-Source: AHgI3IYI8Mrkl9sIvzKrFauj37J0UYsJGW3KMf/nM0/luHYA7P2H8cN3XIUWOLCKh5cQ/YIuPYb03g== X-Received: by 2002:a5d:6803:: with SMTP id w3mr592638wru.272.1549305391768; Mon, 04 Feb 2019 10:36:31 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 4 Feb 2019 19:35:13 +0100 Message-Id: <1549305379-51117-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1549305379-51117-1-git-send-email-pbonzini@redhat.com> References: <1549305379-51117-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::429 Subject: [Qemu-devel] [PULL 11/77] 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: Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Laurent Vivier 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 Signed-off-by: Paolo Bonzini --- cpus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpus.c b/cpus.c index b09b702..154daf5 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 1.8.3.1