mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
pc-dimm: factor out capacity and slot checks into MemoryDevice
Move the checks into memory_device_get_free_addr(). This will check before doing any calculations if we have KVM/vhost slots left and if the total region size would be exceeded. Of course, while at it, make it independent of pc-dimm code. Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180423165126.15441-7-david@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
bb0831bdf4
commit
1b6d6af21b
3 changed files with 51 additions and 61 deletions
|
@ -78,7 +78,6 @@ typedef struct PCDIMMDeviceClass {
|
|||
|
||||
int pc_dimm_get_free_slot(const int *hint, int max_slots, Error **errp);
|
||||
|
||||
uint64_t pc_existing_dimms_capacity(Error **errp);
|
||||
void pc_dimm_memory_plug(DeviceState *dev, MachineState *machine,
|
||||
uint64_t align, Error **errp);
|
||||
void pc_dimm_memory_unplug(DeviceState *dev, MachineState *machine);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue