mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
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:
parent
7a6f391376
commit
b666d23950
5 changed files with 7 additions and 6 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue