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 C8D7292E2E for ; Mon, 2 Jan 2023 13:38:12 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A968E2FA3E for ; Mon, 2 Jan 2023 13:37:42 +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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 2 Jan 2023 13:37:42 +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 BC327443DD for ; Mon, 2 Jan 2023 13:37:41 +0100 (CET) From: Christoph Heiss To: pve-devel@lists.proxmox.com Date: Mon, 2 Jan 2023 13:36:32 +0100 Message-Id: <20230102123633.2493599-2-c.heiss@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230102123633.2493599-1-c.heiss@proxmox.com> References: <20230102123633.2493599-1-c.heiss@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.004 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% 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 Subject: [pve-devel] [PATCH manager] vzdump: pass logfunc down into storage plugin when updating volume attribute 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: Mon, 02 Jan 2023 12:38:12 -0000 Signed-off-by: Christoph Heiss --- PVE/VZDump.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm index a04837e7..6086e80a 100644 --- a/PVE/VZDump.pm +++ b/PVE/VZDump.pm @@ -1079,6 +1079,8 @@ sub exec_backup_task { debugmsg ('info', "archive file size: $cs", $logfd); } + my $logfunc = sub { debugmsg($_[0], $_[1], $logfd) }; + # Mark as protected before pruning. if (my $storeid = $opts->{storage}) { my $volname = $opts->{pbs} ? $task->{target} : basename($task->{target}); @@ -1090,14 +1092,14 @@ sub exec_backup_task { if (my $err = $@) { debugmsg('warn', "unable to add notes - $err", $logfd); } else { - eval { PVE::Storage::update_volume_attribute($cfg, $volid, 'notes', $notes) }; + eval { PVE::Storage::update_volume_attribute($cfg, $volid, 'notes', $notes, $logfunc) }; debugmsg('warn', "unable to add notes - $@", $logfd) if $@; } } if ($opts->{protected}) { debugmsg('info', "marking backup as protected", $logfd); - eval { PVE::Storage::update_volume_attribute($cfg, $volid, 'protected', 1) }; + eval { PVE::Storage::update_volume_attribute($cfg, $volid, 'protected', 1, $logfunc) }; die "unable to set protected flag - $@\n" if $@; } } @@ -1126,7 +1128,7 @@ sub exec_backup_task { $vmid, $vmtype, 0, - sub { debugmsg($_[0], $_[1], $logfd) }, + $logfunc, ); $pruned = scalar(grep { $_->{mark} eq 'remove' } $pruned_list->@*); } -- 2.30.2