aboutsummaryrefslogtreecommitdiff
path: root/block/io.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-05-19 17:05:50 -0600
committerStefan Hajnoczi <stefanha@redhat.com>2016-06-07 14:40:51 +0100
commit41574268b7e61ab98384ca7048f3fec862433401 (patch)
tree17cc862299e256b05cce314f17712a166d49e2fe /block/io.c
parent117bc3fa22d359db6c4f0c10f34c8c9e00ed64af (diff)
downloadqemu-41574268b7e61ab98384ca7048f3fec862433401.zip
qemu-41574268b7e61ab98384ca7048f3fec862433401.tar.gz
qemu-41574268b7e61ab98384ca7048f3fec862433401.tar.bz2
block: Move BlockRequest type to io.c
I was thrown by the fact that the public type BlockRequest had an anonymous union, but no obvious discriminator. Turns out that the only client of the second branch of the union was code internal to io.c, now that commit 91c6e4b killed public multiwrite, so move it into io.c and improve the comments. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1463699150-19445-1-git-send-email-eblake@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com>
Diffstat (limited to 'block/io.c')
-rw-r--r--block/io.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/block/io.c b/block/io.c
index e12f303..a2fba67 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1902,6 +1902,27 @@ void bdrv_aio_cancel_async(BlockAIOCB *acb)
/**************************************************************/
/* async block device emulation */
+typedef struct BlockRequest {
+ union {
+ /* Used during read, write, trim */
+ struct {
+ int64_t sector;
+ int nb_sectors;
+ int flags;
+ QEMUIOVector *qiov;
+ };
+ /* Used during ioctl */
+ struct {
+ int req;
+ void *buf;
+ };
+ };
+ BlockCompletionFunc *cb;
+ void *opaque;
+
+ int error;
+} BlockRequest;
+
typedef struct BlockAIOCBCoroutine {
BlockAIOCB common;
BlockRequest req;