From mboxrd@z Thu Jan 1 00:00:00 1970 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) From: Igor Mammedov 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> Subject: [Qemu-devel] [RFC 20/42] machine: add cpu-hotplug machine option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mst@redhat.com, ehabkost@redhat.com, marcel@redhat.com, eblake@redhat.com, armbru@redhat.com, drjones@redhat.com 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; -- 1.8.3.1