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>
This commit is contained in:
Kevin Wolf 2010-05-05 11:44:39 +02:00
parent 7a6f391376
commit b666d23950
5 changed files with 7 additions and 6 deletions

View file

@ -338,7 +338,7 @@ typedef struct QCowAIOCB {
static void qcow_aio_cancel(BlockDriverAIOCB *blockacb)
{
QCowAIOCB *acb = (QCowAIOCB *)blockacb;
QCowAIOCB *acb = container_of(blockacb, QCowAIOCB, common);
if (acb->hd_aiocb)
bdrv_aio_cancel(acb->hd_aiocb);
qemu_aio_release(acb);