diff options
author | David Hildenbrand <david@redhat.com> | 2018-04-23 18:51:17 +0200 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2018-05-07 10:00:02 -0300 |
commit | b0c14ec4efe912ae6f14a4802574f7b6b6db0648 (patch) | |
tree | 87e01fb55fb216721e888739603d07eee337a716 /include/hw/boards.h | |
parent | 2cc0e2e8140f43ccc6aced6e47c9c2db15ce2330 (diff) |
machine: make MemoryHotplugState accessible via the machine
Let's allow to query the MemoryHotplugState directly from the machine.
If the pointer is NULL, the machine does not support memory devices. If
the pointer is !NULL, the machine supports memory devices and the
data structure contains information about the applicable physical
guest address space region.
This allows us to generically detect if a certain machine has support
for memory devices, and to generically manage it (find free address
range, plug/unplug a memory region).
We will rename "MemoryHotplugState" to something more meaningful
("DeviceMemory") after we completed factoring out the pc-dimm code into
MemoryDevice code.
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20180423165126.15441-3-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
[ehabkost: rebased series, solved conflicts at spapr.c]
[ehabkost: squashed fix to use g_malloc0()]
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include/hw/boards.h')
-rw-r--r-- | include/hw/boards.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/hw/boards.h b/include/hw/boards.h index 5c5eee55e6..e27c28b514 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -214,6 +214,17 @@ struct MachineClass { }; /** + * MemoryHotplugState: + * @base: address in guest physical address space where the memory + * address space for memory devices starts + * @mr: address space container for memory devices + */ +typedef struct MemoryHotplugState { + hwaddr base; + MemoryRegion mr; +} MemoryHotplugState; + +/** * MachineState: */ struct MachineState { @@ -243,6 +254,7 @@ struct MachineState { bool enforce_config_section; bool enable_graphics; char *memory_encryption; + MemoryHotplugState *device_memory; ram_addr_t ram_size; ram_addr_t maxram_size; |