summaryrefslogtreecommitdiffstats
path: root/hw/i386
diff options
context:
space:
mode:
authorIgor Mammedov2014-06-02 15:25:25 +0200
committerMichael S. Tsirkin2014-06-19 15:41:51 +0200
commit3fbcdc27b18b383039b360be1cedf52a1ffb2dff (patch)
tree0dcfd7cb4e738e81067b86b683d9b848fc841df6 /hw/i386
parentpc: add acpi-device link to PCMachineState (diff)
downloadqemu-3fbcdc27b18b383039b360be1cedf52a1ffb2dff.tar.gz
qemu-3fbcdc27b18b383039b360be1cedf52a1ffb2dff.tar.xz
qemu-3fbcdc27b18b383039b360be1cedf52a1ffb2dff.zip
pc: propagate memory hotplug event to ACPI device
Notify PIIX4_PM/ICH9LPC device about hotplug event, so that it would send SCI to guest notifying about newly added memory. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/i386')
-rw-r--r--hw/i386/pc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index c9d888fac6..0bedd4695e 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1549,6 +1549,7 @@ static void pc_dimm_plug(HotplugHandler *hotplug_dev,
DeviceState *dev, Error **errp)
{
int slot;
+ HotplugHandlerClass *hhc;
Error *local_err = NULL;
PCMachineState *pcms = PC_MACHINE(hotplug_dev);
MachineState *machine = MACHINE(hotplug_dev);
@@ -1591,9 +1592,18 @@ static void pc_dimm_plug(HotplugHandler *hotplug_dev,
}
trace_mhp_pc_dimm_assigned_slot(slot);
+ if (!pcms->acpi_dev) {
+ error_setg(&local_err,
+ "memory hotplug is not enabled: missing acpi device");
+ goto out;
+ }
+
memory_region_add_subregion(&pcms->hotplug_memory,
addr - pcms->hotplug_memory_base, mr);
vmstate_register_ram(mr, dev);
+
+ hhc = HOTPLUG_HANDLER_GET_CLASS(pcms->acpi_dev);
+ hhc->plug(HOTPLUG_HANDLER(pcms->acpi_dev), dev, &local_err);
out:
error_propagate(errp, local_err);
}