static int inject_error(BlockDriverState *bs, BlkdebugRule *rule)

{

    BDRVBlkdebugState *s = bs->opaque;

    int error = rule->options.inject.error;

    bool immediately = rule->options.inject.immediately;



    if (rule->options.inject.once) {

        QSIMPLEQ_REMOVE(&s->active_rules, rule, BlkdebugRule, active_next);

        remove_rule(rule);

    }



    if (!immediately) {

        aio_co_schedule(qemu_get_current_aio_context(), qemu_coroutine_self());

        qemu_coroutine_yield();

    }



    return -error;

}

static int inject_error(BlockDriverState *bs, BlkdebugRule *rule)

{

    BDRVBlkdebugState *s = bs->opaque;

    int error = rule->options.inject.error;

    bool immediately = rule->options.inject.immediately;



    if (rule->options.inject.once) {

        QSIMPLEQ_REMOVE(&s->active_rules, rule, BlkdebugRule, active_next);

        remove_rule(rule);

    }



    if (!immediately) {

        aio_co_schedule(qemu_get_current_aio_context(), qemu_coroutine_self());

        qemu_coroutine_yield();

    }



    return -error;

}

static int FUNC_0(BlockDriverState *VAR_0, BlkdebugRule *VAR_1)

{

    BDRVBlkdebugState *s = VAR_0->opaque;

    int VAR_2 = VAR_1->options.inject.VAR_2;

    bool immediately = VAR_1->options.inject.immediately;



    if (VAR_1->options.inject.once) {

        QSIMPLEQ_REMOVE(&s->active_rules, VAR_1, BlkdebugRule, active_next);

        remove_rule(VAR_1);

    }



    if (!immediately) {

        aio_co_schedule(qemu_get_current_aio_context(), qemu_coroutine_self());

        qemu_coroutine_yield();

    }



    return -VAR_2;

}

static int FUNC_0(BlockDriverState *VAR_0, BlkdebugRule *VAR_1)
{ BDRVBlkdebugState *s = VAR_0->opaque; int VAR_2 = VAR_1->options.inject.VAR_2; bool immediately = VAR_1->options.inject.immediately; if (VAR_1->options.inject.once) { QSIMPLEQ_REMOVE(&s->active_rules, VAR_1, BlkdebugRule, active_next); remove_rule(VAR_1); } if (!immediately) { aio_co_schedule(qemu_get_current_aio_context(), qemu_coroutine_self()); qemu_coroutine_yield(); } return -VAR_2; }