int bdrv_flush(BlockDriverState *bs)

{

    Coroutine *co;

    RwCo rwco = {

        .bs = bs,

        .ret = NOT_DONE,

    };



    if (qemu_in_coroutine()) {

        /* Fast-path if already in coroutine context */

        bdrv_flush_co_entry(&rwco);

    } else {

        AioContext *aio_context = bdrv_get_aio_context(bs);



        co = qemu_coroutine_create(bdrv_flush_co_entry);

        qemu_coroutine_enter(co, &rwco);

        while (rwco.ret == NOT_DONE) {

            aio_poll(aio_context, true);

        }

    }



    return rwco.ret;

}

int bdrv_flush(BlockDriverState *bs)

{

    Coroutine *co;

    RwCo rwco = {

        .bs = bs,

        .ret = NOT_DONE,

    };



    if (qemu_in_coroutine()) {

        

        bdrv_flush_co_entry(&rwco);

    } else {

        AioContext *aio_context = bdrv_get_aio_context(bs);



        co = qemu_coroutine_create(bdrv_flush_co_entry);

        qemu_coroutine_enter(co, &rwco);

        while (rwco.ret == NOT_DONE) {

            aio_poll(aio_context, true);

        }

    }



    return rwco.ret;

}

int FUNC_0(BlockDriverState *VAR_0)

{

    Coroutine *co;

    RwCo rwco = {

        .VAR_0 = VAR_0,

        .ret = NOT_DONE,

    };



    if (qemu_in_coroutine()) {

        

        bdrv_flush_co_entry(&rwco);

    } else {

        AioContext *aio_context = bdrv_get_aio_context(VAR_0);



        co = qemu_coroutine_create(bdrv_flush_co_entry);

        qemu_coroutine_enter(co, &rwco);

        while (rwco.ret == NOT_DONE) {

            aio_poll(aio_context, true);

        }

    }



    return rwco.ret;

}

int FUNC_0(BlockDriverState *VAR_0)
{ Coroutine *co; RwCo rwco = { .VAR_0 = VAR_0,
.ret = NOT_DONE,
}; if (qemu_in_coroutine()) { bdrv_flush_co_entry(&rwco); } else { AioContext *aio_context = bdrv_get_aio_context(VAR_0); co = qemu_coroutine_create(bdrv_flush_co_entry); qemu_coroutine_enter(co, &rwco); while (rwco.ret == NOT_DONE) { aio_poll(aio_context, true); } } return rwco.ret; }