From patchwork Mon May 2 12:33:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 8992731 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 132A59F39D for ; Mon, 2 May 2016 14:38:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7580A201B4 for ; Mon, 2 May 2016 14:38:08 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 6C75120173 for ; Mon, 2 May 2016 14:38:07 +0000 (UTC) Received: from localhost ([::1]:36426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axDCf-0004fQ-N8 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 02 May 2016 08:43:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axD3r-0006ZF-Rf for qemu-devel@nongnu.org; Mon, 02 May 2016 08:34:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axD3g-0008UO-7t for qemu-devel@nongnu.org; Mon, 02 May 2016 08:34:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axD3g-0008Qj-2f for qemu-devel@nongnu.org; Mon, 02 May 2016 08:34:40 -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 F2FF283F46 for ; Mon, 2 May 2016 12:34:28 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.34.112.60]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u42CXqc7000450; Mon, 2 May 2016 08:34:27 -0400 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Mon, 2 May 2016 14:33:29 +0200 Message-Id: <1462192431-146342-21-git-send-email-imammedo@redhat.com> In-Reply-To: <1462192431-146342-1-git-send-email-imammedo@redhat.com> References: <1462192431-146342-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 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] [RFC 20/42] machine: add cpu-hotplug machine option 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: drjones@redhat.com, ehabkost@redhat.com, mst@redhat.com, armbru@redhat.com, marcel@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Igor Mammedov --- hw/core/machine.c | 20 ++++++++++++++++++++ include/hw/boards.h | 1 + 2 files changed, 21 insertions(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index 6dbbc85..498230a 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -329,6 +329,20 @@ static bool machine_get_enforce_config_section(Object *obj, Error **errp) return ms->enforce_config_section; } +static bool machine_get_cpu_hotplug(Object *obj, Error **errp) +{ + MachineState *ms = MACHINE(obj); + + return ms->cpu_hotplug; +} + +static void machine_set_cpu_hotplug(Object *obj, bool value, Error **errp) +{ + MachineState *ms = MACHINE(obj); + + ms->cpu_hotplug = value; +} + static int error_on_sysbus_device(SysBusDevice *sbdev, void *opaque) { error_report("Option '-device %s' cannot be handled by this machine", @@ -490,6 +504,12 @@ static void machine_initfn(Object *obj) object_property_set_description(obj, "enforce-config-section", "Set on to enforce configuration section migration", NULL); + object_property_add_bool(obj, "cpu-hotplug", + machine_get_cpu_hotplug, + machine_set_cpu_hotplug, NULL); + object_property_set_description(obj, "cpu-hotplug", + "Set on to enable CPU hotplug", + NULL); /* Register notifier when init is done for sysbus sanity checks */ ms->sysbus_notifier.notify = machine_init_notify; diff --git a/include/hw/boards.h b/include/hw/boards.h index 8d4fe56..d388f96 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -154,6 +154,7 @@ struct MachineState { bool iommu; bool suppress_vmdesc; bool enforce_config_section; + bool cpu_hotplug; ram_addr_t ram_size; ram_addr_t maxram_size;