blkdebug_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes,
                   QEMUIOVector *qiov, int flags)
{
    BDRVBlkdebugState *s = bs->opaque;
    BlkdebugRule *rule = NULL;
    QSIMPLEQ_FOREACH(rule, &s->active_rules, active_next) {
        uint64_t inject_offset = rule->options.inject.offset;
        if (inject_offset == -1 ||
            (inject_offset >= offset && inject_offset < offset + bytes))
        {
            break;
    if (rule && rule->options.inject.error) {
        return inject_error(bs, rule);
    return bdrv_co_preadv(bs->file, offset, bytes, qiov, flags);
blkdebug_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes,
                   QEMUIOVector *qiov, int flags)
{
    BDRVBlkdebugState *s = bs->opaque;
    BlkdebugRule *rule = NULL;
    QSIMPLEQ_FOREACH(rule, &s->active_rules, active_next) {
        uint64_t inject_offset = rule->options.inject.offset;
        if (inject_offset == -1 ||
            (inject_offset >= offset && inject_offset < offset + bytes))
        {
            break;
    if (rule && rule->options.inject.error) {
        return inject_error(bs, rule);
    return bdrv_co_preadv(bs->file, offset, bytes, qiov, flags);
FUNC_0(BlockDriverState *VAR_0, uint64_t VAR_1, uint64_t VAR_2,
                   QEMUIOVector *VAR_3, int VAR_4)
{
    BDRVBlkdebugState *s = VAR_0->opaque;
    BlkdebugRule *rule = NULL;
    QSIMPLEQ_FOREACH(rule, &s->active_rules, active_next) {
        uint64_t inject_offset = rule->options.inject.VAR_1;
        if (inject_offset == -1 ||
            (inject_offset >= VAR_1 && inject_offset < VAR_1 + VAR_2))
        {
            break;
    if (rule && rule->options.inject.error) {
        return inject_error(VAR_0, rule);
    return bdrv_co_preadv(VAR_0->file, VAR_1, VAR_2, VAR_3, VAR_4);
FUNC_0(BlockDriverState *VAR_0, uint64_t VAR_1, uint64_t VAR_2,
QEMUIOVector *VAR_3, int VAR_4)
{ BDRVBlkdebugState *s = VAR_0->opaque; BlkdebugRule *rule = NULL; QSIMPLEQ_FOREACH(rule, &s->active_rules, active_next) { uint64_t inject_offset = rule->options.inject.VAR_1; if (inject_offset == -1 ||
(inject_offset >= VAR_1 && inject_offset < VAR_1 + VAR_2))
{ break; if (rule && rule->options.inject.error) { return inject_error(VAR_0, rule); return bdrv_co_preadv(VAR_0->file, VAR_1, VAR_2, VAR_3, VAR_4);