From: Wolfgang Bumiller Date: Tue, 30 Jan 2018 12:20:06 +0000 (+0100) Subject: schema: add bwlimit standard option and format X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=2d167ad0d47d50df5e14ce6af942196840655e97;hp=70ea22506939f9687e1146c0f35247cfbe9225b8;ds=sidebyside schema: add bwlimit standard option and format Signed-off-by: Wolfgang Bumiller --- 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) = @_;