From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v3 manager 1/4] vzdump: actually honor schema defaults for performance
Date: Tue, 7 Nov 2023 14:49:24 +0100 [thread overview]
Message-ID: <20231107134928.81303-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20231107134928.81303-1-f.ebner@proxmox.com>
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>
---
New in v3.
PVE/VZDump.pm | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 454ab494..182fb80b 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -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); };
--
2.39.2
next prev parent reply other threads:[~2023-11-07 13:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-07 13:49 [pve-devel] [PATCH-SERIES v3 manager/docs] close #4513: add performance tab for backup jobs Fiona Ebner
2023-11-07 13:49 ` Fiona Ebner [this message]
2023-11-07 13:49 ` [pve-devel] [PATCH v3 manager 2/4] vzdump: use per-property fallback for performance settings Fiona Ebner
2023-11-07 13:49 ` [pve-devel] [PATCH v3 manager 3/4] close #4513: ui: backup job: add performance tab Fiona Ebner
2023-11-07 13:49 ` [pve-devel] [PATCH v3 manager 4/4] ui: backup job: disable zstd thread count field when zstd isn't used Fiona Ebner
2023-11-07 13:49 ` [pve-devel] [PATCH v3 docs 5/5] backup: update information about performance settings Fiona Ebner
2024-03-25 14:09 ` [pve-devel] [PATCH-SERIES v3 manager/docs] close #4513: add performance tab for backup jobs Fiona Ebner
2024-04-16 10:16 ` Thomas Lamprecht
2024-04-16 12:11 ` Fiona Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231107134928.81303-2-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox