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-changelog

[Xen-changelog] [xen-unstable] Loop on actual elfnote array size rather

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Loop on actual elfnote array size rather than depending on ELFNOTE_MAX
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Feb 2007 12:20:24 -0800
Delivery-date: Wed, 28 Feb 2007 12:21:54 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1172655899 0
# Node ID 40dc331c44235359f2993c012381afc4cb9d263a
# Parent  9149ef0e61ce24ba3a12c27d0cfd7de6b86aff43
Loop on actual elfnote array size rather than depending on ELFNOTE_MAX
macro.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 tools/python/xen/lowlevel/xc/xc.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff -r 9149ef0e61ce -r 40dc331c4423 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Wed Feb 28 09:41:02 2007 +0000
+++ b/tools/python/xen/lowlevel/xc/xc.c Wed Feb 28 09:44:59 2007 +0000
@@ -22,6 +22,8 @@
 #include "xc_dom.h"
 #include <xen/hvm/hvm_info_table.h>
 #include <xen/hvm/params.h>
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 
 /* Needed for Python versions earlier than 2.3. */
 #ifndef PyMODINIT_FUNC
@@ -419,10 +421,13 @@ static PyObject *pyxc_linux_build(XcObje
        goto out;
     }
 
-    if (!(elfnote_dict = PyDict_New()))
+    if ( !(elfnote_dict = PyDict_New()) )
        goto out;
-    for (i = 0; i <= XEN_ELFNOTE_MAX; i++) {
-       switch (dom->parms.elf_notes[i].type) {
+    
+    for ( i = 0; i < ARRAY_SIZE(dom->parms.elf_notes); i++ )
+    {
+       switch ( dom->parms.elf_notes[i].type )
+        {
        case XEN_ENT_NONE:
            continue;
        case XEN_ENT_LONG:

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Loop on actual elfnote array size rather than depending on ELFNOTE_MAX, Xen patchbot-unstable <=