]> git.proxmox.com Git - pve-manager.git/commitdiff
vzdump: actually honor schema defaults for performance
authorFiona Ebner <f.ebner@proxmox.com>
Tue, 16 Apr 2024 12:09:51 +0000 (14:09 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 17 Apr 2024 14:05:09 +0000 (16:05 +0200)
The 'performance' option itself defines no 'default' in the schema, so
what happened is that the defaults used by the backends (i.e. QEMU and
proxmox-backup-client) would be used. Luckily, they correspond to the
default values defined in the schema, i.e. in the 'backup-performance'
format. Make the code future-proof and use the actual defaults defined
in the schema instead of relying on that correspondence.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/VZDump.pm

index 152eb3e5dfb4a99c5c7a41fa4c426973d5393daa..b084fb5df75a56ac4b525f8b2cfb127b30e2cd86 100644 (file)
@@ -277,8 +277,14 @@ sub read_vzdump_defaults {
             defined($default) ? ($_ => $default) : ()
        } keys %$confdesc_for_defaults
     };
+    my $performance_fmt = PVE::JSONSchema::get_format('backup-performance');
+    $defaults->{performance} = {
+       map {
+           my $default = $performance_fmt->{$_}->{default};
+           defined($default) ? ($_ => $default) : ()
+       } keys $performance_fmt->%*
+    };
     $parse_prune_backups_maxfiles->($defaults, "defaults in VZDump schema");
-    parse_performance($defaults);
 
     my $raw;
     eval { $raw = PVE::Tools::file_get_contents($fn); };