]> git.proxmox.com Git - pve-common.git/commitdiff
schema: add bwlimit standard option and format
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 30 Jan 2018 12:20:06 +0000 (13:20 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 5 Feb 2018 08:49:21 +0000 (09:49 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/PVE/JSONSchema.pm

index 4bc7cbb5b75235d59962e0a19a973bb5ef1de170..9861a8f380d0a07296986026ccc0d45621786025 100644 (file)
@@ -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) = @_;