Commit b26ded9a authored by Kevin Wolf's avatar Kevin Wolf
Browse files

Revert "block: Forbid I/O throttling on nodes with multiple parents for 2.6"



This reverts commit 76b22320.

Now that I/O throttling is fully done on the BlockBackend level, there
is no reason any more to block I/O throttling for nodes with multiple
parents as the parents don't influence each other any more.

Conflicts:
	block.c

Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Reviewed-by: default avatarAlberto Garcia <berto@igalia.com>
Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent 08e83aab
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -1522,12 +1522,6 @@ static int bdrv_open_inherit(BlockDriverState **pbs, const char *filename,
            return -ENODEV;
        }

        if (bs->blk && blk_get_public(bs->blk)->throttle_state) {
            error_setg(errp, "Cannot reference an existing block device for "
                       "which I/O throttling is enabled");
            return -EINVAL;
        }

        bdrv_ref(bs);
        *pbs = bs;
        return 0;
+0 −7
Original line number Diff line number Diff line
@@ -2652,13 +2652,6 @@ void qmp_block_set_io_throttle(const char *device, int64_t bps, int64_t bps_rd,
        goto out;
    }

    /* The BlockBackend must be the only parent */
    assert(QLIST_FIRST(&bs->parents));
    if (QLIST_NEXT(QLIST_FIRST(&bs->parents), next_parent)) {
        error_setg(errp, "Cannot throttle device with multiple parents");
        goto out;
    }

    throttle_config_init(&cfg);
    cfg.buckets[THROTTLE_BPS_TOTAL].avg = bps;
    cfg.buckets[THROTTLE_BPS_READ].avg  = bps_rd;