]> git.proxmox.com Git - mirror_qemu.git/commit - hw/i386/pc.c
pc-dimm: add busy address check and address auto-allocation
authorIgor Mammedov <imammedo@redhat.com>
Mon, 2 Jun 2014 13:25:13 +0000 (15:25 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 19 Jun 2014 13:41:49 +0000 (16:41 +0300)
commit0b3125711606374f04e279aebefcb7275480f040
tree4d917c4e2c127a6d044aa3a0113ed7f67e9a0c16
parent95bee274fd1d22dc6d35e52987f8b5d29fe754dd
pc-dimm: add busy address check and address auto-allocation

- if 'addr' property is not specified on -device/device_add command,
treat the default value as request for assigning PCDIMMDevice to
the first free memory region.

- if 'addr' is provided with -device/device_add command, attempt to
use it or fail command if it's already occupied or falls inside
of an existing PCDIMMDevice memory region.

Note:
GCompareFunc(a, b) used by g_slist_insert_sorted() returns 'gint',
however it might be too small to fit difference between
2 addresses. So use 128bit to calculate the difference and normalize
result to -1/0/1 return values.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Andrey Korolyov <andrey@xdel.ru>
MST: commit log tweaks
hw/i386/pc.c
hw/mem/pc-dimm.c
include/hw/mem/pc-dimm.h