[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] blktap2: Fix build with gcc3. Cannot handle defining a function which



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.