[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/16] dimm: introduce memory added notifier
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 12/16] dimm: introduce memory added notifier |
Date: |
Tue, 23 Jul 2013 18:23:08 +0200 |
it will notify ACPI subsystem about added DimmDevice
Signed-off-by: Igor Mammedov <address@hidden>
---
hw/mem-hotplug/dimm.c | 13 +++++++++++++
include/sysemu/sysemu.h | 3 +++
stubs/Makefile.objs | 1 +
stubs/memory_hotplug.c | 6 ++++++
4 files changed, 23 insertions(+), 0 deletions(-)
create mode 100644 stubs/memory_hotplug.c
diff --git a/hw/mem-hotplug/dimm.c b/hw/mem-hotplug/dimm.c
index 7e3e383..4ecc590 100644
--- a/hw/mem-hotplug/dimm.c
+++ b/hw/mem-hotplug/dimm.c
@@ -22,6 +22,17 @@
#include "qemu/config-file.h"
#include "qemu/bitmap.h"
#include "qemu/range.h"
+#include "qemu/notify.h"
+#include "sysemu/sysemu.h"
+
+/* Memory hot-plug notifiers */
+static NotifierList mem_added_notifiers =
+ NOTIFIER_LIST_INITIALIZER(mem_added_notifiers);
+
+void qemu_register_mem_added_notifier(Notifier *notifier)
+{
+ notifier_list_add(&mem_added_notifiers, notifier);
+}
static void dimm_bus_initfn(Object *obj)
{
@@ -204,6 +215,8 @@ static void dimm_realize(DeviceState *dev, Error **errp)
g_assert(dc->register_memory);
dc->register_memory(bus, dimm, errp);
+
+ notifier_list_notify(&mem_added_notifiers, dev);
}
static void dimm_class_init(ObjectClass *klass, void *data)
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 2fb71af..9abbf71 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -156,6 +156,9 @@ void drive_hot_add(Monitor *mon, const QDict *qdict);
/* CPU hotplug */
void qemu_register_cpu_added_notifier(Notifier *notifier);
+/* Memory hotplug */
+void qemu_register_mem_added_notifier(Notifier *notifier);
+
/* pcie aer error injection */
void pcie_aer_inject_error_print(Monitor *mon, const QObject *data);
int do_pcie_aer_inject_error(Monitor *mon,
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index 9b701b4..2476c3d 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -25,3 +25,4 @@ stub-obj-y += vm-stop.o
stub-obj-y += vmstate.o
stub-obj-$(CONFIG_WIN32) += fd-register.o
stub-obj-y += cpus.o
+stub-obj-y += memory_hotplug.o
diff --git a/stubs/memory_hotplug.c b/stubs/memory_hotplug.c
new file mode 100644
index 0000000..60844f1
--- /dev/null
+++ b/stubs/memory_hotplug.c
@@ -0,0 +1,6 @@
+#include "qemu/notify.h"
+#include "sysemu/sysemu.h"
+
+void qemu_register_mem_added_notifier(Notifier *notifier)
+{
+}
--
1.7.1
- [Qemu-devel] [PATCH 05/16] qdev: Add SIZE type to qdev properties, (continued)
- [Qemu-devel] [PATCH 05/16] qdev: Add SIZE type to qdev properties, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 06/16] dimm: implement dimm device abstraction, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 07/16] dimm: map DimmDevice into DimBus provided address space, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 08/16] pc: piix: make hotplug memory gap in high memory, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 09/16] pc: i440fx: add DimmBus to chipset and map it into hotplug memory region, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 10/16] dimm: add busy slot check and slot auto-allocation, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 11/16] dimm: add busy address check and address auto-allocation, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 12/16] dimm: introduce memory added notifier,
Igor Mammedov <=
- [Qemu-devel] [PATCH 13/16] acpi/piix4: introduce memory hot-plug interface QEMU<->ACPI BIOS, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 14/16] pc: ACPI BIOS: implement memory hotplug interface, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 15/16] pc: update acpi-dsdt.hex.generated and add ssdt-mem.hex.generated, Igor Mammedov, 2013/07/23
- [Qemu-devel] [PATCH 16/16] pc: ACPI BIOS: reserve SRAT entry for hotplug mem hole, Igor Mammedov, 2013/07/23
- Re: [Qemu-devel] [PATCH 00/16 RFC v6] ACPI memory hotplug, Hu Tao, 2013/07/24