diff options
author | Kevin Wolf <kwolf@redhat.com> | 2010-05-05 11:44:39 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2010-05-17 10:20:05 +0200 |
commit | b666d239509a0855740444c254a65cbf567bfb90 (patch) | |
tree | e8d2539f1ad8d0c9578974bfe74fb5ad3b5008e4 /block/vdi.c | |
parent | 7a6f391376c61af1dce2d624a4fcff8eec4fa097 (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/vdi.c')
-rw-r--r-- | block/vdi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/vdi.c b/block/vdi.c index 1d257b4838..2b4d2c218d 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -469,7 +469,7 @@ static int vdi_is_allocated(BlockDriverState *bs, int64_t sector_num, static void vdi_aio_cancel(BlockDriverAIOCB *blockacb) { /* TODO: This code is untested. How can I get it executed? */ - VdiAIOCB *acb = (VdiAIOCB *)blockacb; + VdiAIOCB *acb = container_of(blockacb, VdiAIOCB, common); logout("\n"); if (acb->hd_aiocb) { bdrv_aio_cancel(acb->hd_aiocb); |