From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 1891D9FF72 for ; Tue, 7 Nov 2023 14:49:33 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id F36ED335CE for ; Tue, 7 Nov 2023 14:49:32 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 7 Nov 2023 14:49:32 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 1806F46EB5 for ; Tue, 7 Nov 2023 14:49:32 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Tue, 7 Nov 2023 14:49:24 +0100 Message-Id: <20231107134928.81303-2-f.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231107134928.81303-1-f.ebner@proxmox.com> References: <20231107134928.81303-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.080 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH v3 manager 1/4] vzdump: actually honor schema defaults for performance X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2023 13:49:33 -0000 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 --- 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