From 2d167ad0d47d50df5e14ce6af942196840655e97 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 30 Jan 2018 13:20:06 +0100 Subject: [PATCH 1/1] schema: add bwlimit standard option and format Signed-off-by: Wolfgang Bumiller --- src/PVE/JSONSchema.pm | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm index 4bc7cbb..9861a8f 100644 --- a/src/PVE/JSONSchema.pm +++ b/src/PVE/JSONSchema.pm @@ -406,6 +406,42 @@ sub pve_verify_startup_order { die "unable to parse startup options\n"; } +my %bwlimit_opt = ( + optional => 1, + type => 'number', minimum => '0', + format_description => 'LIMIT', +); + +my $bwlimit_format = { + default => { + %bwlimit_opt, + description => 'default bandwidth limit in MiB/s', + }, + restore => { + %bwlimit_opt, + description => 'bandwidth limit in MiB/s for restoring guests from backups', + }, + migration => { + %bwlimit_opt, + description => 'bandwidth limit in MiB/s for migrating guests', + }, + clone => { + %bwlimit_opt, + description => 'bandwidth limit in MiB/s for cloning disks', + }, + move => { + %bwlimit_opt, + description => 'bandwidth limit in MiB/s for moving disks', + }, +}; +register_format('bwlimit', $bwlimit_format); +register_standard_option('bwlimit', { + description => "Set bandwidth/io limits various operations.", + optional => 1, + type => 'string', + format => $bwlimit_format, +}); + sub pve_parse_startup_order { my ($value) = @_; -- 2.39.2