block: Add ioctl parameter fields to BlockRequest
authorFam Zheng <famz@redhat.com>
Mon, 9 Nov 2015 10:16:50 +0000 (18:16 +0800)
committerKevin Wolf <kwolf@redhat.com>
Thu, 12 Nov 2015 15:22:42 +0000 (16:22 +0100)
The two fields that will be used by ioctl handling code later are added
as union, because it's used exclusively by ioctl code which dosn't need
the four fields in the other struct of the union.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 1447064214-29930-6-git-send-email-famz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
include/block/block.h

index 610db923d55f71c6ef64f62fdbd6d77c172acac3..c8b40b739fa97b82910157bfea54b8162b0c2c82 100644 (file)
@@ -335,10 +335,18 @@ void bdrv_aio_cancel_async(BlockAIOCB *acb);
 
 typedef struct BlockRequest {
     /* Fields to be filled by multiwrite caller */
-    int64_t sector;
-    int nb_sectors;
-    int flags;
-    QEMUIOVector *qiov;
+    union {
+        struct {
+            int64_t sector;
+            int nb_sectors;
+            int flags;
+            QEMUIOVector *qiov;
+        };
+        struct {
+            int req;
+            void *buf;
+        };
+    };
     BlockCompletionFunc *cb;
     void *opaque;