From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9Gza-0003jc-Ou for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y9GzT-0006VV-8z for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:30 -0500 Received: from e38.co.us.ibm.com ([32.97.110.159]:52971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9GzS-0006UQ-Kg for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:23 -0500 Received: from /spool/local by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Jan 2015 10:35:22 -0700 From: Michael Roth Date: Thu, 8 Jan 2015 11:33:29 -0600 Message-Id: <1420738472-23267-26-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1420738472-23267-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1420738472-23267-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 25/88] pc-dimm: Don't check dimm->node when there is non-NUMA config List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: zhanghailiang It should not break memory hotplug feature if there is non-NUMA option. This patch would also allow to use pc-dimm as replacement for initial memory for non-NUMA configs. Note: After this patch, the memory hotplug can work normally for Linux guest OS when there is non-NUMA option and NUMA option. But not support Windows guest OS to hotplug memory with no-NUMA config, actully, it's Windows limitation. Reviewed-By: Igor Mammedov Signed-off-by: zhanghailiang Acked-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit fc50ff0666315be5120c70ad00cd0b0097484b84) Signed-off-by: Michael Roth --- hw/mem/pc-dimm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 5bfc5b7..a800ea7 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -252,7 +252,7 @@ static void pc_dimm_realize(DeviceState *dev, Error **errp) error_setg(errp, "'" PC_DIMM_MEMDEV_PROP "' property is not set"); return; } - if (dimm->node >= nb_numa_nodes) { + if ((nb_numa_nodes > 0) && (dimm->node >= nb_numa_nodes)) { error_setg(errp, "'DIMM property " PC_DIMM_NODE_PROP " has value %" PRIu32 "' which exceeds the number of numa nodes: %d", dimm->node, nb_numa_nodes); -- 1.9.1