[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 031/103] pc: add "hotplug-memory-region-size" propert
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 031/103] pc: add "hotplug-memory-region-size" property to PC_MACHINE |
Date: |
Tue, 17 Jun 2014 20:38:05 +0300 |
From: Igor Mammedov <address@hidden>
... it will be used by acpi-build code and by unit tests
Signed-off-by: Igor Mammedov <address@hidden>
Acked-by: Peter Crosthwaite <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/i386/pc.h | 1 +
hw/i386/pc.c | 19 +++++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 6050115..a2bf22c 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -35,6 +35,7 @@ struct PCMachineState {
};
#define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
+#define PC_MACHINE_MEMHP_REGION_SIZE "hotplug-memory-region-size"
/**
* PCMachineClass:
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index ffecb33..8444bf9 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -60,6 +60,7 @@
#include "acpi-build.h"
#include "hw/mem/pc-dimm.h"
#include "trace.h"
+#include "qapi/visitor.h"
/* debug PC/ISA interrupts */
//#define DEBUG_IRQ
@@ -1633,6 +1634,23 @@ static HotplugHandler
*pc_get_hotpug_handler(MachineState *machine,
pcmc->get_hotplug_handler(machine, dev) : NULL;
}
+static void
+pc_machine_get_hotplug_memory_region_size(Object *obj, Visitor *v, void
*opaque,
+ const char *name, Error **errp)
+{
+ PCMachineState *pcms = PC_MACHINE(obj);
+ int64_t value = memory_region_size(&pcms->hotplug_memory);
+
+ visit_type_int(v, &value, name, errp);
+}
+
+static void pc_machine_initfn(Object *obj)
+{
+ object_property_add(obj, PC_MACHINE_MEMHP_REGION_SIZE, "int",
+ pc_machine_get_hotplug_memory_region_size,
+ NULL, NULL, NULL, NULL);
+}
+
static void pc_machine_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@@ -1649,6 +1667,7 @@ static const TypeInfo pc_machine_info = {
.parent = TYPE_MACHINE,
.abstract = true,
.instance_size = sizeof(PCMachineState),
+ .instance_init = pc_machine_initfn,
.class_size = sizeof(PCMachineClass),
.class_init = pc_machine_class_init,
.interfaces = (InterfaceInfo[]) {
--
MST
- [Qemu-devel] [PULL 022/103] trace: pc: add PC_DIMM slot & address allocation, (continued)
- [Qemu-devel] [PULL 022/103] trace: pc: add PC_DIMM slot & address allocation, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 012/103] pc: initialize memory hotplug address space, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 024/103] acpi:piix4: add memory hotplug handling, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 023/103] acpi:piix4: allow plug/unlug callbacks handle not only PCI devices, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 025/103] pc: ich9 lpc: make it work with global/compat properties, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 016/103] pc: add memory hotplug handler to PC_MACHINE, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 026/103] acpi:ich9: add memory hotplug handling, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 027/103] pc: migrate piix4 & ich9 MemHotplugState, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 029/103] pc: propagate memory hotplug event to ACPI device, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 030/103] pc: ACPI BIOS: implement memory hotplug interface, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 031/103] pc: add "hotplug-memory-region-size" property to PC_MACHINE,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 028/103] pc: add acpi-device link to PCMachineState, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 033/103] pc: ACPI BIOS: make GPE.3 handle memory hotplug event on PIIX and Q35 machines, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 037/103] virtio: Drop superfluous conditionals around g_strdup(), Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 039/103] ich: get rid of spaces in type name, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 040/103] pc: q35: acpi: report error to user on unsupported unplug request, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 038/103] qtest: fix hex2nib for capital characters, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 032/103] pc: ACPI BIOS: reserve SRAT entry for hotplug mem hole, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 041/103] migration: export SELF_ANNOUNCE_ROUNDS, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 042/103] migration: introduce self_announce_delay(), Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 043/103] virtio-net: announce self by guest, Michael S. Tsirkin, 2014/06/17