From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etmaa-00088Y-W5 for qemu-devel@nongnu.org; Wed, 07 Mar 2018 22:51:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etmaX-0002Ry-Uc for qemu-devel@nongnu.org; Wed, 07 Mar 2018 22:51:33 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:38874 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1etmaX-0002Rk-PH for qemu-devel@nongnu.org; Wed, 07 Mar 2018 22:51:29 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w283o704131026 for ; Wed, 7 Mar 2018 22:51:28 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 2gjudbv70b-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Wed, 07 Mar 2018 22:51:27 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Mar 2018 03:51:25 -0000 Date: Thu, 8 Mar 2018 09:21:14 +0530 From: Bharata B Rao Reply-To: bharata@linux.vnet.ibm.com References: <20180308023337.21062-1-haozhong.zhang@intel.com> <20180308023337.21062-2-haozhong.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180308023337.21062-2-haozhong.zhang@intel.com> Message-Id: <20180308035114.GB2001@in.ibm.com> Subject: Re: [Qemu-devel] [PATCH v4 1/5] pc-dimm: make qmp_pc_dimm_device_list() sort devices by address List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Haozhong Zhang Cc: qemu-devel@nongnu.org, mst@redhat.com, Igor Mammedov , Xiao Guangrong , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum , Stefan Hajnoczi , Dan Williams , David Gibson , Alexander Graf , Markus Armbruster , qemu-ppc@nongnu.org On Thu, Mar 08, 2018 at 10:33:33AM +0800, Haozhong Zhang wrote: > Make qmp_pc_dimm_device_list() return sorted by start address > list of devices so that it could be reused in places that > would need sorted list*. Reuse existing pc_dimm_built_list() > to get sorted list. > > While at it hide recursive callbacks from callers, so that: > > qmp_pc_dimm_device_list(qdev_get_machine(), &list); > > could be replaced with simpler: > > list = qmp_pc_dimm_device_list(); > > * follow up patch will use it in build_srat() > > Signed-off-by: Haozhong Zhang > Reviewed-by: Igor Mammedov > --- > hw/mem/pc-dimm.c | 83 +++++++++++++++++++++++++----------------------- > hw/ppc/spapr.c | 3 +- I have used this patch with SPAPR to implement the new device tree property ibm,dynamic-memory-v2 at http://patchwork.ozlabs.org/patch/882387/ Reviewed-by: Bharata B Rao