From nobody Sun Apr 28 18:56:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1508138081965693.557949521259; Mon, 16 Oct 2017 00:14:41 -0700 (PDT) Received: from localhost ([::1]:59703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3zbj-0002XH-7x for importer@patchew.org; Mon, 16 Oct 2017 03:14:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3zRB-0001kz-HO for qemu-devel@nongnu.org; Mon, 16 Oct 2017 03:03:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3zR8-0003Mv-DX for qemu-devel@nongnu.org; Mon, 16 Oct 2017 03:03:45 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46820 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3zR8-0003MD-7z for qemu-devel@nongnu.org; Mon, 16 Oct 2017 03:03:42 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9G72b6W036262 for ; Mon, 16 Oct 2017 03:03:38 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 2dmq08a9k2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 16 Oct 2017 03:03:37 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 16 Oct 2017 08:03:36 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 16 Oct 2017 08:03:33 +0100 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9G73Vbs27459738 for ; Mon, 16 Oct 2017 07:03:33 GMT Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v9G73MJE017662 for ; Mon, 16 Oct 2017 18:03:22 +1100 Received: from bharata.in.ibm.com ([9.124.35.69]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v9G73KOJ017570; Mon, 16 Oct 2017 18:03:21 +1100 From: Bharata B Rao To: qemu-devel@nongnu.org Date: Mon, 16 Oct 2017 12:33:26 +0530 X-Mailer: git-send-email 2.7.4 X-TM-AS-MML: disable x-cbid: 17101607-0020-0000-0000-000003C11FD1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17101607-0021-0000-0000-0000425553A2 Message-Id: <1508137406-5222-1-git-send-email-bharata@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-10-16_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710160100 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [FIX PATCH] monitor: Don't return CPU marked for unplug as monitor CPU 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: Bharata B Rao , sathnaga@linux.vnet.ibm.com, dgilbert@redhat.com, armbru@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The following sequence of steps kill the QEMU: - Hotplug a CPU - Change the default CPU to the newly hotplugged cpu using "cpu" HMP comman= d. - Hot unplug the CPU - Run "info cpus" Fix this by not letting monitor_get_cpu() to return a CPU which is marked for unplug. Reported-by: Satheesh Rajendran Signed-off-by: Bharata B Rao --- monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index fe0d1bd..8d60e57 100644 --- a/monitor.c +++ b/monitor.c @@ -1053,7 +1053,7 @@ int monitor_set_cpu(int cpu_index) =20 CPUState *mon_get_cpu(void) { - if (!cur_mon->mon_cpu) { + if (!cur_mon->mon_cpu || cur_mon->mon_cpu->unplug) { if (!first_cpu) { return NULL; } --=20 2.7.4