Commit 22338fea authored by Samuel Ortiz's avatar Samuel Ortiz Committed by Michael S. Tsirkin
Browse files

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: default avatarSamuel Ortiz <sameo@linux.intel.com>
Signed-off-by: default avatarShameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Reviewed-by: default avatarEric Auger <eric.auger@redhat.com>
Reviewed-by: default avatarIgor Mammedov <imammedo@redhat.com>
Message-Id: <20190918130633.4872-3-shameerali.kolothum.thodi@huawei.com>
Acked-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 091c466e
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -712,10 +712,12 @@ void build_memory_hotplug_aml(Aml *table, uint32_t nr_mem,
    }
    aml_append(table, dev_container);

    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(method, aml_call0(MEMORY_DEVICES_CONTAINER "."
                                     MEMORY_SLOT_SCAN_METHOD));
        aml_append(table, method);
    }

    g_free(mhp_res_path);
}