From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: [PATCH for-4.6 v3 1/3] xl: fix vNUMA vdistance parsing Date: Mon, 17 Aug 2015 19:56:59 +0100 Message-ID: <1439837821-8930-2-git-send-email-wei.liu2@citrix.com> References: <1439837821-8930-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZRPaj-0003Xy-Kc for xen-devel@lists.xenproject.org; Mon, 17 Aug 2015 18:57:05 +0000 In-Reply-To: <1439837821-8930-1-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Wei Liu , Dario Faggioli , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org We should parse the output from splitting function, not the original string, otherwise the parsed result is wrong. For example: vnuma = [ [...,"vdistance=10,20",...], [...,"vdistance=20,10",...] ] Before this change, vdistance from node 0 to all nodes (including itself) was 10 and vdistance from node 1 to all nodes was 20. After this change, vdistance from node 0 to itself is 10, to node 1 is 20 and vdistance from node 1 to node 0 is 20, to itself is 10. That's the correct vdistance settings we expect. Signed-off-by: Wei Liu Reviewed-by: Dario Faggioli --- v3: better commit message --- tools/libxl/xl_cmdimpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index c6b0b68..44fff82 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1188,7 +1188,7 @@ static void parse_vnuma_config(const XLU_Config *config, len = libxl_string_list_length(&vdist); for (j = 0; j < len; j++) { - val = parse_ulong(value); + val = parse_ulong(vdist[j]); p->distances[j] = val; } libxl_string_list_dispose(&vdist); -- 2.1.4