aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-06-12 12:42:15 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-06-12 12:42:15 +0100
commit59f3a1c6ac72cad98486c50ae23afe7d0abdde2c (patch)
tree6e5c822db69cc71a385e06e93f9a4da009aecb6a /hw
parent5eca450b2ec219c4256062bfb5498c726c1ed0a4 (diff)
parent11c39b5cd966ddc067a1ca0c5392ec9b666c45b7 (diff)
downloadqemu-59f3a1c6ac72cad98486c50ae23afe7d0abdde2c.zip
qemu-59f3a1c6ac72cad98486c50ae23afe7d0abdde2c.tar.gz
qemu-59f3a1c6ac72cad98486c50ae23afe7d0abdde2c.tar.bz2
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
pc: fixes A couple of fixes to acpi and nvdimm. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon 11 Jun 2018 20:21:03 BST # gpg: using RSA key 281F0DB8D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * remotes/mst/tags/for_upstream: nvdimm: make persistence option symbolic hw/i386: Update SSDT table used by "make check" Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/acpi/nvdimm.c4
-rw-r--r--hw/i386/pc.c35
2 files changed, 19 insertions, 20 deletions
diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
index 87e4280..27eeb66 100644
--- a/hw/acpi/nvdimm.c
+++ b/hw/acpi/nvdimm.c
@@ -404,8 +404,8 @@ static GArray *nvdimm_build_device_structure(AcpiNVDIMMState *state)
}
g_slist_free(device_list);
- if (state->capabilities) {
- nvdimm_build_structure_caps(structures, state->capabilities);
+ if (state->persistence) {
+ nvdimm_build_structure_caps(structures, state->persistence);
}
return structures;
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index f3befe6..5bba9dc 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -2181,31 +2181,30 @@ static void pc_machine_set_nvdimm(Object *obj, bool value, Error **errp)
pcms->acpi_nvdimm_state.is_enabled = value;
}
-static void pc_machine_get_nvdimm_capabilities(Object *obj, Visitor *v,
- const char *name, void *opaque,
- Error **errp)
+static char *pc_machine_get_nvdimm_persistence(Object *obj, Error **errp)
{
PCMachineState *pcms = PC_MACHINE(obj);
- uint32_t value = pcms->acpi_nvdimm_state.capabilities;
- visit_type_uint32(v, name, &value, errp);
+ return g_strdup(pcms->acpi_nvdimm_state.persistence_string);
}
-static void pc_machine_set_nvdimm_capabilities(Object *obj, Visitor *v,
- const char *name, void *opaque,
+static void pc_machine_set_nvdimm_persistence(Object *obj, const char *value,
Error **errp)
{
PCMachineState *pcms = PC_MACHINE(obj);
- Error *error = NULL;
- uint32_t value;
-
- visit_type_uint32(v, name, &value, &error);
- if (error) {
- error_propagate(errp, error);
- return;
+ AcpiNVDIMMState *nvdimm_state = &pcms->acpi_nvdimm_state;
+
+ if (strcmp(value, "cpu") == 0)
+ nvdimm_state->persistence = 3;
+ else if (strcmp(value, "mem-ctrl") == 0)
+ nvdimm_state->persistence = 2;
+ else {
+ error_report("-machine nvdimm-persistence=%s: unsupported option", value);
+ exit(EXIT_FAILURE);
}
- pcms->acpi_nvdimm_state.capabilities = value;
+ g_free(nvdimm_state->persistence_string);
+ nvdimm_state->persistence_string = g_strdup(value);
}
static bool pc_machine_get_smbus(Object *obj, Error **errp)
@@ -2421,9 +2420,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(oc, PC_MACHINE_NVDIMM_CAP, "uint32",
- pc_machine_get_nvdimm_capabilities,
- pc_machine_set_nvdimm_capabilities, NULL, NULL, &error_abort);
+ object_class_property_add_str(oc, PC_MACHINE_NVDIMM_PERSIST,
+ pc_machine_get_nvdimm_persistence,
+ pc_machine_set_nvdimm_persistence, &error_abort);
object_class_property_add_bool(oc, PC_MACHINE_SMBUS,
pc_machine_get_smbus, pc_machine_set_smbus, &error_abort);