WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] correct indexing in xc_cpu_to_node_t map

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] correct indexing in xc_cpu_to_node_t map
From: beth kon <eak@xxxxxxxxxx>
Date: Fri, 17 Aug 2007 16:04:35 -0400
Delivery-date: Fri, 17 Aug 2007 13:07:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: IBM
Reply-to: eak@xxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501)
Looks like there is a nit with initilizing the map array. It needs one more element than MAX_CPU_ID since indexing starts at 0.

Signed-off-by: Beth Kon <eak@xxxxxxxxxx>

diff -r 256160ff19b7 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Thu Aug 16 13:27:59 2007 +0100
+++ b/tools/python/xen/lowlevel/xc/xc.c Fri Aug 17 15:44:22 2007 -0400
@@ -685,7 +685,7 @@ static PyObject *pyxc_physinfo(XcObject
    char cpu_cap[128], *p=cpu_cap, *q=cpu_cap;
    int i, j, max_cpu_id;
    PyObject *ret_obj, *node_to_cpu_obj;
-    xc_cpu_to_node_t map[MAX_CPU_ID];
+    xc_cpu_to_node_t map[MAX_CPU_ID + 1];

    set_xen_guest_handle(info.cpu_to_node, map);
    info.max_cpu_id = MAX_CPU_ID;

--
Elizabeth Kon (Beth)
IBM Linux Technology Center
Open Hypervisor Team
email: eak@xxxxxxxxxx


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] correct indexing in xc_cpu_to_node_t map, beth kon <=