qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC 20/42] machine: add cpu-hotplug machine option


From: Igor Mammedov
Subject: [Qemu-devel] [RFC 20/42] machine: add cpu-hotplug machine option
Date: Mon, 2 May 2016 14:33:29 +0200

Signed-off-by: Igor Mammedov <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]