From patchwork Wed Jul 6 06:20:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 9215557 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1AE4A6048B for ; Wed, 6 Jul 2016 06:44:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CDD828704 for ; Wed, 6 Jul 2016 06:44:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0176228706; Wed, 6 Jul 2016 06:44:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AE55828704 for ; Wed, 6 Jul 2016 06:44:19 +0000 (UTC) Received: from localhost ([::1]:59644 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKgZG-0007BJ-Tm for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Jul 2016 02:44:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKgDl-0006wL-P3 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 02:22:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKgDj-0004ai-R5 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 02:22:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKgDj-0004ad-Lj for qemu-devel@nongnu.org; Wed, 06 Jul 2016 02:22:03 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 500F81176D5; Wed, 6 Jul 2016 06:22:03 +0000 (UTC) Received: from 172-15-179-184.lightspeed.austtx.sbcglobal.net (ovpn-112-22.ams2.redhat.com [10.36.112.22]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u666KvAM014835; Wed, 6 Jul 2016 02:22:00 -0400 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Wed, 6 Jul 2016 08:20:55 +0200 Message-Id: <1467786055-85835-20-git-send-email-imammedo@redhat.com> In-Reply-To: <1467786055-85835-1-git-send-email-imammedo@redhat.com> References: <1467786055-85835-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 06 Jul 2016 06:22:03 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 19/19] pc: make device_del CPU work for x86 CPUs 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: pkrempa@redhat.com, ehabkost@redhat.com, mst@redhat.com, armbru@redhat.com, eduardo.otubo@profitbricks.com, marcel@redhat.com, pbonzini@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP ACPI subsystem already has all logic in place the only thing left to eject CPU is destroy it and ammend present CPUs counter in CMOS, do so. Signed-off-by: Igor Mammedov --- hw/i386/pc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 0f85b56..ca1953c 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1736,6 +1736,7 @@ static void pc_cpu_unplug_request_cb(HotplugHandler *hotplug_dev, static void pc_cpu_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { + CPUArchId *found_cpu; HotplugHandlerClass *hhc; Error *local_err = NULL; PCMachineState *pcms = PC_MACHINE(hotplug_dev); @@ -1747,13 +1748,11 @@ static void pc_cpu_unplug_cb(HotplugHandler *hotplug_dev, goto out; } - /* - * TODO: enable unplug once generic CPU remove bits land - * for now guest will be able to eject CPU ACPI wise but - * it will come back again on machine reset. - */ - /* object_unparent(OBJECT(dev)); */ + found_cpu = pc_find_cpu_slot(pcms, CPU(dev), NULL); + found_cpu->cpu = NULL; + object_unparent(OBJECT(dev)); + rtc_set_memory(pcms->rtc, 0x5f, rtc_get_memory(pcms->rtc, 0x5f) - 1); out: error_propagate(errp, local_err); }