aboutsummaryrefslogtreecommitdiff
path: root/block/blkdebug.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2010-05-05 11:44:39 +0200
committerKevin Wolf <kwolf@redhat.com>2010-05-17 10:20:05 +0200
commitb666d239509a0855740444c254a65cbf567bfb90 (patch)
treee8d2539f1ad8d0c9578974bfe74fb5ad3b5008e4 /block/blkdebug.c
parent7a6f391376c61af1dce2d624a4fcff8eec4fa097 (diff)
downloadqemu-b666d239509a0855740444c254a65cbf567bfb90.zip
qemu-b666d239509a0855740444c254a65cbf567bfb90.tar.gz
qemu-b666d239509a0855740444c254a65cbf567bfb90.tar.bz2
block: Avoid unchecked casts for AIOCBs
Use container_of for one direction and &acb->common for the other one. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/blkdebug.c')
-rw-r--r--block/blkdebug.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blkdebug.c b/block/blkdebug.c
index bb4a91a..8325f75 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -320,7 +320,7 @@ static void error_callback_bh(void *opaque)
static void blkdebug_aio_cancel(BlockDriverAIOCB *blockacb)
{
- BlkdebugAIOCB *acb = (BlkdebugAIOCB*) blockacb;
+ BlkdebugAIOCB *acb = container_of(blockacb, BlkdebugAIOCB, common);
qemu_aio_release(acb);
}
@@ -347,7 +347,7 @@ static BlockDriverAIOCB *inject_error(BlockDriverState *bs,
acb->bh = bh;
qemu_bh_schedule(bh);
- return (BlockDriverAIOCB*) acb;
+ return &acb->common;
}
static BlockDriverAIOCB *blkdebug_aio_readv(BlockDriverState *bs,