void bdrv_set_aio_context(BlockDriverState *bs, AioContext *new_context)
{
    bdrv_drain(bs); /* ensure there are no in-flight requests */
    bdrv_detach_aio_context(bs);
    /* This function executes in the old AioContext so acquire the new one in
     * case it runs in a different thread.
     */
    aio_context_acquire(new_context);
    bdrv_attach_aio_context(bs, new_context);
    aio_context_release(new_context);
void bdrv_set_aio_context(BlockDriverState *bs, AioContext *new_context)
{
    bdrv_drain(bs); 
    bdrv_detach_aio_context(bs);
    


    aio_context_acquire(new_context);
    bdrv_attach_aio_context(bs, new_context);
    aio_context_release(new_context);
void FUNC_0(BlockDriverState *VAR_0, AioContext *VAR_1)
{
    bdrv_drain(VAR_0); 
    bdrv_detach_aio_context(VAR_0);
    


    aio_context_acquire(VAR_1);
    bdrv_attach_aio_context(VAR_0, VAR_1);
    aio_context_release(VAR_1);
void FUNC_0(BlockDriverState *VAR_0, AioContext *VAR_1)
{ bdrv_drain(VAR_0); bdrv_detach_aio_context(VAR_0); aio_context_acquire(VAR_1); bdrv_attach_aio_context(VAR_0, VAR_1); aio_context_release(VAR_1);