summaryrefslogtreecommitdiffstats
path: root/hw/acpi/memory_hotplug.c
diff options
context:
space:
mode:
authorSamuel Ortiz2019-09-18 15:06:24 +0200
committerMichael S. Tsirkin2019-10-05 23:12:08 +0200
commit22338fea781cd26618b775afec068bc7238ff5c6 (patch)
tree4f1f0287930c63bd12c067efe679f8d5dcdb8698 /hw/acpi/memory_hotplug.c
parenthw/acpi: Make ACPI IO address space configurable (diff)
downloadqemu-22338fea781cd26618b775afec068bc7238ff5c6.tar.gz
qemu-22338fea781cd26618b775afec068bc7238ff5c6.tar.xz
qemu-22338fea781cd26618b775afec068bc7238ff5c6.zip
hw/acpi: Do not create memory hotplug method when handler is not defined
With Hardware-reduced ACPI, the GED device will manage ACPI hotplug entirely. As a consequence, make the memory specific events AML generation optional. The code will only be added when the method name is not NULL. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20190918130633.4872-3-shameerali.kolothum.thodi@huawei.com> Acked-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/acpi/memory_hotplug.c')
-rw-r--r--hw/acpi/memory_hotplug.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index 9b0b150f4f..8d2e82240f 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -712,10 +712,12 @@ void build_memory_hotplug_aml(Aml *table, uint32_t nr_mem,
}
aml_append(table, dev_container);
- method = aml_method(event_handler_method, 0, AML_NOTSERIALIZED);
- aml_append(method,
- aml_call0(MEMORY_DEVICES_CONTAINER "." MEMORY_SLOT_SCAN_METHOD));
- aml_append(table, method);
+ if (event_handler_method) {
+ method = aml_method(event_handler_method, 0, AML_NOTSERIALIZED);
+ aml_append(method, aml_call0(MEMORY_DEVICES_CONTAINER "."
+ MEMORY_SLOT_SCAN_METHOD));
+ aml_append(table, method);
+ }
g_free(mhp_res_path);
}