]> git.proxmox.com Git - mirror_qemu.git/commit - hw/mem/memory-device.c
pc-dimm: factor out capacity and slot checks into MemoryDevice
authorDavid Hildenbrand <david@redhat.com>
Mon, 23 Apr 2018 16:51:21 +0000 (18:51 +0200)
committerEduardo Habkost <ehabkost@redhat.com>
Mon, 7 May 2018 13:00:02 +0000 (10:00 -0300)
commit1b6d6af21bd614d61b55a28177299a5c93b95cd9
tree136ba1a8d1ae2a9fc7c04e8ca8d0d5246390a424
parentbb0831bdf45a61c83fa1def44ae391260ce2662d
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>
hw/mem/memory-device.c
hw/mem/pc-dimm.c
include/hw/mem/pc-dimm.h