int bdrv_flush_all(void)

{

    BlockDriverState *bs = NULL;

    int result = 0;



    while ((bs = bdrv_next(bs))) {

        AioContext *aio_context = bdrv_get_aio_context(bs);

        int ret;



        aio_context_acquire(aio_context);

        ret = bdrv_flush(bs);

        if (ret < 0 && !result) {

            result = ret;

        }

        aio_context_release(aio_context);

    }



    return result;

}

int bdrv_flush_all(void)

{

    BlockDriverState *bs = NULL;

    int result = 0;



    while ((bs = bdrv_next(bs))) {

        AioContext *aio_context = bdrv_get_aio_context(bs);

        int ret;



        aio_context_acquire(aio_context);

        ret = bdrv_flush(bs);

        if (ret < 0 && !result) {

            result = ret;

        }

        aio_context_release(aio_context);

    }



    return result;

}

int FUNC_0(void)

{

    BlockDriverState *bs = NULL;

    int VAR_0 = 0;



    while ((bs = bdrv_next(bs))) {

        AioContext *aio_context = bdrv_get_aio_context(bs);

        int VAR_1;



        aio_context_acquire(aio_context);

        VAR_1 = bdrv_flush(bs);

        if (VAR_1 < 0 && !VAR_0) {

            VAR_0 = VAR_1;

        }

        aio_context_release(aio_context);

    }



    return VAR_0;

}

int FUNC_0(void)
{ BlockDriverState *bs = NULL; int VAR_0 = 0; while ((bs = bdrv_next(bs))) { AioContext *aio_context = bdrv_get_aio_context(bs); int VAR_1; aio_context_acquire(aio_context); VAR_1 = bdrv_flush(bs); if (VAR_1 < 0 && !VAR_0) { VAR_0 = VAR_1; } aio_context_release(aio_context); } return VAR_0; }