static int bdrv_prwv_co(BdrvChild *child, int64_t offset,

                        QEMUIOVector *qiov, bool is_write,

                        BdrvRequestFlags flags)

{

    Coroutine *co;

    RwCo rwco = {

        .child = child,

        .offset = offset,

        .qiov = qiov,

        .is_write = is_write,

        .ret = NOT_DONE,

        .flags = flags,

    };



    if (qemu_in_coroutine()) {

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

        bdrv_rw_co_entry(&rwco);

    } else {

        AioContext *aio_context = bdrv_get_aio_context(child->bs);



        co = qemu_coroutine_create(bdrv_rw_co_entry, &rwco);

        qemu_coroutine_enter(co);

        while (rwco.ret == NOT_DONE) {

            aio_poll(aio_context, true);

        }

    }

    return rwco.ret;

}

static int bdrv_prwv_co(BdrvChild *child, int64_t offset,

                        QEMUIOVector *qiov, bool is_write,

                        BdrvRequestFlags flags)

{

    Coroutine *co;

    RwCo rwco = {

        .child = child,

        .offset = offset,

        .qiov = qiov,

        .is_write = is_write,

        .ret = NOT_DONE,

        .flags = flags,

    };



    if (qemu_in_coroutine()) {

        

        bdrv_rw_co_entry(&rwco);

    } else {

        AioContext *aio_context = bdrv_get_aio_context(child->bs);



        co = qemu_coroutine_create(bdrv_rw_co_entry, &rwco);

        qemu_coroutine_enter(co);

        while (rwco.ret == NOT_DONE) {

            aio_poll(aio_context, true);

        }

    }

    return rwco.ret;

}

static int FUNC_0(BdrvChild *VAR_0, int64_t VAR_1,

                        QEMUIOVector *VAR_2, bool VAR_3,

                        BdrvRequestFlags VAR_4)

{

    Coroutine *co;

    RwCo rwco = {

        .VAR_0 = VAR_0,

        .VAR_1 = VAR_1,

        .VAR_2 = VAR_2,

        .VAR_3 = VAR_3,

        .ret = NOT_DONE,

        .VAR_4 = VAR_4,

    };



    if (qemu_in_coroutine()) {

        

        bdrv_rw_co_entry(&rwco);

    } else {

        AioContext *aio_context = bdrv_get_aio_context(VAR_0->bs);



        co = qemu_coroutine_create(bdrv_rw_co_entry, &rwco);

        qemu_coroutine_enter(co);

        while (rwco.ret == NOT_DONE) {

            aio_poll(aio_context, true);

        }

    }

    return rwco.ret;

}

static int FUNC_0(BdrvChild *VAR_0, int64_t VAR_1,
QEMUIOVector *VAR_2, bool VAR_3,
BdrvRequestFlags VAR_4)
{ Coroutine *co; RwCo rwco = { .VAR_0 = VAR_0,
.VAR_1 = VAR_1,
.VAR_2 = VAR_2,
.VAR_3 = VAR_3,
.ret = NOT_DONE,
.VAR_4 = VAR_4,
}; if (qemu_in_coroutine()) { bdrv_rw_co_entry(&rwco); } else { AioContext *aio_context = bdrv_get_aio_context(VAR_0->bs); co = qemu_coroutine_create(bdrv_rw_co_entry, &rwco); qemu_coroutine_enter(co); while (rwco.ret == NOT_DONE) { aio_poll(aio_context, true); } } return rwco.ret; }