static int blkdebug_co_flush(BlockDriverState *bs)

{

    BDRVBlkdebugState *s = bs->opaque;

    BlkdebugRule *rule = NULL;



    QSIMPLEQ_FOREACH(rule, &s->active_rules, active_next) {

        if (rule->options.inject.offset == -1) {

            break;

        }

    }



    if (rule && rule->options.inject.error) {

        return inject_error(bs, rule);

    }



    return bdrv_co_flush(bs->file->bs);

}

static int blkdebug_co_flush(BlockDriverState *bs)

{

    BDRVBlkdebugState *s = bs->opaque;

    BlkdebugRule *rule = NULL;



    QSIMPLEQ_FOREACH(rule, &s->active_rules, active_next) {

        if (rule->options.inject.offset == -1) {

            break;

        }

    }



    if (rule && rule->options.inject.error) {

        return inject_error(bs, rule);

    }



    return bdrv_co_flush(bs->file->bs);

}

static int FUNC_0(BlockDriverState *VAR_0)

{

    BDRVBlkdebugState *s = VAR_0->opaque;

    BlkdebugRule *rule = NULL;



    QSIMPLEQ_FOREACH(rule, &s->active_rules, active_next) {

        if (rule->options.inject.offset == -1) {

            break;

        }

    }



    if (rule && rule->options.inject.error) {

        return inject_error(VAR_0, rule);

    }



    return bdrv_co_flush(VAR_0->file->VAR_0);

}

static int FUNC_0(BlockDriverState *VAR_0)
{ BDRVBlkdebugState *s = VAR_0->opaque; BlkdebugRule *rule = NULL; QSIMPLEQ_FOREACH(rule, &s->active_rules, active_next) { if (rule->options.inject.offset == -1) { break; } } if (rule && rule->options.inject.error) { return inject_error(VAR_0, rule); } return bdrv_co_flush(VAR_0->file->VAR_0); }