void bdrv_detach_aio_context(BlockDriverState *bs)

{

    BdrvAioNotifier *baf;



    if (!bs->drv) {

        return;

    }



    QLIST_FOREACH(baf, &bs->aio_notifiers, list) {

        baf->detach_aio_context(baf->opaque);

    }



    if (bs->io_limits_enabled) {

        throttle_timers_detach_aio_context(&bs->throttle_timers);

    }

    if (bs->drv->bdrv_detach_aio_context) {

        bs->drv->bdrv_detach_aio_context(bs);

    }

    if (bs->file) {

        bdrv_detach_aio_context(bs->file->bs);

    }

    if (bs->backing) {

        bdrv_detach_aio_context(bs->backing->bs);

    }



    bs->aio_context = NULL;

}

void bdrv_detach_aio_context(BlockDriverState *bs)

{

    BdrvAioNotifier *baf;



    if (!bs->drv) {

        return;

    }



    QLIST_FOREACH(baf, &bs->aio_notifiers, list) {

        baf->detach_aio_context(baf->opaque);

    }



    if (bs->io_limits_enabled) {

        throttle_timers_detach_aio_context(&bs->throttle_timers);

    }

    if (bs->drv->bdrv_detach_aio_context) {

        bs->drv->bdrv_detach_aio_context(bs);

    }

    if (bs->file) {

        bdrv_detach_aio_context(bs->file->bs);

    }

    if (bs->backing) {

        bdrv_detach_aio_context(bs->backing->bs);

    }



    bs->aio_context = NULL;

}

void FUNC_0(BlockDriverState *VAR_0)

{

    BdrvAioNotifier *baf;



    if (!VAR_0->drv) {

        return;

    }



    QLIST_FOREACH(baf, &VAR_0->aio_notifiers, list) {

        baf->detach_aio_context(baf->opaque);

    }



    if (VAR_0->io_limits_enabled) {

        throttle_timers_detach_aio_context(&VAR_0->throttle_timers);

    }

    if (VAR_0->drv->FUNC_0) {

        VAR_0->drv->FUNC_0(VAR_0);

    }

    if (VAR_0->file) {

        FUNC_0(VAR_0->file->VAR_0);

    }

    if (VAR_0->backing) {

        FUNC_0(VAR_0->backing->VAR_0);

    }



    VAR_0->aio_context = NULL;

}

void FUNC_0(BlockDriverState *VAR_0)
{ BdrvAioNotifier *baf; if (!VAR_0->drv) { return; } QLIST_FOREACH(baf, &VAR_0->aio_notifiers, list) { baf->detach_aio_context(baf->opaque); } if (VAR_0->io_limits_enabled) { throttle_timers_detach_aio_context(&VAR_0->throttle_timers); } if (VAR_0->drv->FUNC_0) { VAR_0->drv->FUNC_0(VAR_0); } if (VAR_0->file) { FUNC_0(VAR_0->file->VAR_0); } if (VAR_0->backing) { FUNC_0(VAR_0->backing->VAR_0); } VAR_0->aio_context = NULL; }