From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM6ia-0006UU-Fc for qemu-devel@nongnu.org; Sun, 02 Aug 2015 23:47:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZM6iT-00021G-Sk for qemu-devel@nongnu.org; Sun, 02 Aug 2015 23:47:16 -0400 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:48049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM6iT-00020F-9L for qemu-devel@nongnu.org; Sun, 02 Aug 2015 23:47:09 -0400 Received: from /spool/local by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 3 Aug 2015 13:47:05 +1000 Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id B5FA52BB0057 for ; Mon, 3 Aug 2015 13:47:03 +1000 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t733ks9e57082096 for ; Mon, 3 Aug 2015 13:47:03 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t733kUKi015834 for ; Mon, 3 Aug 2015 13:46:30 +1000 Date: Mon, 3 Aug 2015 09:16:10 +0530 From: Bharata B Rao Message-ID: <20150803034610.GA5776@in.ibm.com> References: <1437137380-1064-1-git-send-email-bharata@linux.vnet.ibm.com> <20150720091528.66836701@nial.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150720091528.66836701@nial.brq.redhat.com> Subject: Re: [Qemu-devel] [FIX PATCH] pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration Reply-To: bharata@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: qemu-devel@nongnu.org, david@gibson.dropbear.id.au On Mon, Jul 20, 2015 at 09:15:28AM +0200, Igor Mammedov wrote: > On Fri, 17 Jul 2015 18:19:40 +0530 > Bharata B Rao wrote: > > > pc_dimm_realize() validates the NUMA node to which memory hotplug is > > being performed only in case of NUMA configuration. Include a check > > to fail invalid nodes in case of non-NUMA configuration too. > > > > Signed-off-by: Bharata B Rao > Reviewed-by: Igor Mammedov > > > --- > > hw/mem/pc-dimm.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c > > index bb04862..099025e 100644 > > --- a/hw/mem/pc-dimm.c > > +++ b/hw/mem/pc-dimm.c > > @@ -414,10 +414,11 @@ static void pc_dimm_realize(DeviceState *dev, Error **errp) > > error_setg(errp, "'" PC_DIMM_MEMDEV_PROP "' property is not set"); > > return; > > } > > - if ((nb_numa_nodes > 0) && (dimm->node >= nb_numa_nodes)) { > > + if (((nb_numa_nodes > 0) && (dimm->node >= nb_numa_nodes)) || > > + (!nb_numa_nodes && dimm->node)) { > > 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); > > + dimm->node, nb_numa_nodes ? nb_numa_nodes : 1); > > return; > > } > > } Eduardo - Will this go via your tree ? Regards, Bharata.