summaryrefslogtreecommitdiff
path: root/block.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.c
parent7a6f391376c61af1dce2d624a4fcff8eec4fa097 (diff)
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.c')
-rw-r--r--block.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block.c b/block.c
index 48305b7d7..6345599de 100644
--- a/block.c
+++ b/block.c
@@ -2108,7 +2108,8 @@ typedef struct BlockDriverAIOCBSync {
static void bdrv_aio_cancel_em(BlockDriverAIOCB *blockacb)
{
- BlockDriverAIOCBSync *acb = (BlockDriverAIOCBSync *)blockacb;
+ BlockDriverAIOCBSync *acb =
+ container_of(blockacb, BlockDriverAIOCBSync, common);
qemu_bh_delete(acb->bh);
acb->bh = NULL;
qemu_aio_release(acb);