From ee2bdc33c913b7d765baa5aa338c29fb30a05c9a Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Tue, 4 Aug 2015 11:22:12 +0100 Subject: throttle: refuse bps_max/iops_max without bps/iops The bps_max/iops_max values are meaningless without corresponding bps/iops values. Reported an error if bps_max/iops_max is given without bps/iops. Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Message-id: 1438683733-21111-2-git-send-email-stefanha@redhat.com --- blockdev.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'blockdev.c') diff --git a/blockdev.c b/blockdev.c index 62a4586cd6..4125ff642a 100644 --- a/blockdev.c +++ b/blockdev.c @@ -337,6 +337,12 @@ static bool check_throttle_config(ThrottleConfig *cfg, Error **errp) return false; } + if (throttle_max_is_missing_limit(cfg)) { + error_setg(errp, "bps_max/iops_max require corresponding" + " bps/iops values"); + return false; + } + return true; } -- cgit v1.2.3