]> xenbits.xensource.com Git - xen.git/commitdiff
blktap2: make protocol specific usage of shared sring explicit
authorKeir Fraser <keir.fraser@citrix.com>
Sun, 15 Aug 2010 20:48:06 +0000 (21:48 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Sun, 15 Aug 2010 20:48:06 +0000 (21:48 +0100)
I don't think protocol specific data really belongs in this header
but since it is already there and we seem to be stuck with it let's at
least make the users explicit lest people get caught out by future new
fields moving the pad field around.

This is the Xen portion of this change. The kernel portion will be
sent separately. There is no dependency between the two.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Daniel Stodden <daniel.stodden@citrix.com>
Cc: Dongxiao Xu <dongxiao.xu@intel.com>
xen-unstable changeset:   feee0abed6aa
xen-unstable date:        Fri Jul 02 18:58:02 2010 +0100

tools/blktap2/drivers/tapdisk-vbd.c
xen/include/public/io/ring.h

index c3321d5cc807f5d25a0c89258ae700157642447c..9d856d5927ba06f0a352f1a7a69f8700426aeaf3 100644 (file)
@@ -1937,7 +1937,7 @@ tapdisk_vbd_check_ring_message(td_vbd_t *vbd)
        if (!vbd->ring.sring)
                return -EINVAL;
 
-       switch (vbd->ring.sring->pad[0]) {
+       switch (vbd->ring.sring->private.tapif_user.msg) {
        case 0:
                return 0;
 
index 0880b1c52ef465d0aae27190adac0f09522b73f9..0c01339722266b31a02602ff0411e2287d746907 100644 (file)
@@ -103,8 +103,16 @@ union __name##_sring_entry {                                            \
 struct __name##_sring {                                                 \
     RING_IDX req_prod, req_event;                                       \
     RING_IDX rsp_prod, rsp_event;                                       \
-    uint8_t  netfront_smartpoll_active;                                 \
-    uint8_t  pad[47];                                                   \
+    union {                                                             \
+        struct {                                                        \
+            uint8_t smartpoll_active;                                   \
+        } netif;                                                        \
+        struct {                                                        \
+            uint8_t msg;                                                \
+        } tapif_user;                                                   \
+        uint8_t pvt_pad[4];                                             \
+    } private;                                                          \
+    uint8_t pad[44];                                                    \
     union __name##_sring_entry ring[1]; /* variable-length */           \
 };                                                                      \
                                                                         \