From 0cd03d89b98154fcc03d9a8eeea70b9c50cb9457 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Mon, 2 Jun 2014 15:25:14 +0200 Subject: pc-dimm: add busy slot check and slot auto-allocation - if slot property is not specified on -device/device_add command, treat default value as request for assigning PCDIMMDevice to the first free slot. - if slot is provided with -device/device_add command, attempt to use it or fail command if it's already occupied. Signed-off-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/mem/pc-dimm.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h index 5a3e7df13c..0f4a6ba1e4 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -74,4 +74,6 @@ uint64_t pc_dimm_get_free_addr(uint64_t address_space_start, uint64_t address_space_size, uint64_t *hint, uint64_t size, Error **errp); + +int pc_dimm_get_free_slot(const int *hint, int max_slots, Error **errp); #endif -- cgit v1.2.3