aboutsummaryrefslogtreecommitdiff
path: root/hw/i386/pc.c
diff options
context:
space:
mode:
authorChao Peng <chao.p.peng@linux.intel.com>2016-11-05 03:19:48 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2016-12-22 16:00:25 +0100
commitbe232eb07692a5d10d07aee8386faa7e860e73ea (patch)
treee637ca7bf1c35a93e3bdcea8d1cfae5a837e8242 /hw/i386/pc.c
parent638cbd452d3a92a2ab18caee73078483d90f64eb (diff)
pc: make smbus configurable
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com> Message-Id: <1478330391-74060-2-git-send-email-chao.p.peng@linux.intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/i386/pc.c')
-rw-r--r--hw/i386/pc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index a9e64a88e5..40bec88681 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -2158,6 +2158,20 @@ static void pc_machine_set_nvdimm(Object *obj, bool value, Error **errp)
pcms->acpi_nvdimm_state.is_enabled = value;
}
+static bool pc_machine_get_smbus(Object *obj, Error **errp)
+{
+ PCMachineState *pcms = PC_MACHINE(obj);
+
+ return pcms->smbus;
+}
+
+static void pc_machine_set_smbus(Object *obj, bool value, Error **errp)
+{
+ PCMachineState *pcms = PC_MACHINE(obj);
+
+ pcms->smbus = value;
+}
+
static void pc_machine_initfn(Object *obj)
{
PCMachineState *pcms = PC_MACHINE(obj);
@@ -2169,6 +2183,7 @@ static void pc_machine_initfn(Object *obj)
pcms->acpi_nvdimm_state.is_enabled = false;
/* acpi build is enabled by default if machine supports it */
pcms->acpi_build_enabled = PC_MACHINE_GET_CLASS(pcms)->has_acpi_build;
+ pcms->smbus = true;
}
static void pc_machine_reset(void)
@@ -2329,6 +2344,9 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
object_class_property_add_bool(oc, PC_MACHINE_NVDIMM,
pc_machine_get_nvdimm, pc_machine_set_nvdimm, &error_abort);
+
+ object_class_property_add_bool(oc, PC_MACHINE_SMBUS,
+ pc_machine_get_smbus, pc_machine_set_smbus, &error_abort);
}
static const TypeInfo pc_machine_info = {