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] This patch fixes two problems with sendin

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] This patch fixes two problems with sending and receiving of (arrays of)
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 09 Mar 2007 11:30:32 -0800
Delivery-date: Fri, 09 Mar 2007 12:21:31 -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 Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1173456259 0
# Node ID 6ff2a1286484f3e068a6ba106cf68b0f611a63cf
# Parent  87cb4916dd757f48190db8055e6691acd2d5d9fc
This patch fixes two problems with sending and receiving of (arrays of)
structures.

The first one allows to determine the size of a member when parsing a
'set'.
The cast in the second part fixes the address calculation when
serializing an array.

Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxx>
---
 tools/libxen/src/xen_common.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -r 87cb4916dd75 -r 6ff2a1286484 tools/libxen/src/xen_common.c
--- a/tools/libxen/src/xen_common.c     Fri Mar 09 12:28:37 2007 +0000
+++ b/tools/libxen/src/xen_common.c     Fri Mar 09 16:04:19 2007 +0000
@@ -890,6 +890,9 @@ static size_t size_of_member(const abstr
     case REF:
         return sizeof(arbitrary_record_opt *);
 
+    case STRUCT:
+        return type->struct_size;
+
     default:
         assert(false);
     }
@@ -1215,7 +1218,8 @@ add_struct_value(const struct abstract_t
 
             for (size_t i = 0; i < set_val->size; i++)
             {
-                void *member_value = set_val->contents + (i * member_size);
+                void *member_value = (char *)set_val->contents +
+                                     (i * member_size);
                 add_struct_value(member_type, member_value,
                                  add_unnamed_value, NULL, data_node);
             }

_______________________________________________
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] This patch fixes two problems with sending and receiving of (arrays of), Xen patchbot-unstable <=