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] blktap2: Fix build with gcc3. Cannot hand

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] blktap2: Fix build with gcc3. Cannot handle defining a function which
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 28 May 2009 03:05:11 -0700
Delivery-date: Thu, 28 May 2009 03:05:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1243504860 -3600
# Node ID ae810b2583943ca242c4e543ddb43c9f2c7a0f1e
# Parent  0e111bfd22d06ee0f05baedabc7928c3dfaf4c0a
blktap2: Fix build with gcc3. Cannot handle defining a function which
is passed a struct-by-value which is not yet fully defined. Thus
defining a request struct which contains a pointer to a function which
is passed-by-value an instance of that request structure is
impossible. We work around it by defining the function poiinter as
void* and then casting in one place.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 tools/blktap2/drivers/tapdisk-interface.c |    2 +-
 tools/blktap2/drivers/tapdisk.h           |   12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff -r 0e111bfd22d0 -r ae810b258394 tools/blktap2/drivers/tapdisk-interface.c
--- a/tools/blktap2/drivers/tapdisk-interface.c Thu May 28 10:19:15 2009 +0100
+++ b/tools/blktap2/drivers/tapdisk-interface.c Thu May 28 11:01:00 2009 +0100
@@ -213,7 +213,7 @@ void
 void
 td_complete_request(td_request_t treq, int res)
 {
-       treq.cb(treq, res);
+       ((td_callback_t)treq.cb)(treq, res);
 }
 
 void
diff -r 0e111bfd22d0 -r ae810b258394 tools/blktap2/drivers/tapdisk.h
--- a/tools/blktap2/drivers/tapdisk.h   Thu May 28 10:19:15 2009 +0100
+++ b/tools/blktap2/drivers/tapdisk.h   Thu May 28 11:01:00 2009 +0100
@@ -104,11 +104,6 @@ typedef struct td_driver_handle      td_
 typedef struct td_driver_handle      td_driver_t;
 typedef struct td_image_handle       td_image_t;
 
-/* 
- * Prototype of the callback to activate as requests complete.
- */
-typedef void (*td_callback_t)(td_request_t, int);
-
 struct td_disk_id {
        char                        *name;
        int                          drivertype;
@@ -130,13 +125,18 @@ struct td_request {
 
        td_image_t                  *image;
 
-       td_callback_t                cb;
+       void * /*td_callback_t*/     cb;
        void                        *cb_data;
 
        uint64_t                     id;
        int                          sidx;
        void                        *private;
 };
+
+/* 
+ * Prototype of the callback to activate as requests complete.
+ */
+typedef void (*td_callback_t)(td_request_t, int);
 
 /* 
  * Structure describing the interface to a virtual disk implementation.

_______________________________________________
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] blktap2: Fix build with gcc3. Cannot handle defining a function which, Xen patchbot-unstable <=