public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] vzdump: pass logfunc down into storage plugin when updating volume attribute
Date: Mon,  2 Jan 2023 13:36:32 +0100	[thread overview]
Message-ID: <20230102123633.2493599-2-c.heiss@proxmox.com> (raw)
In-Reply-To: <20230102123633.2493599-1-c.heiss@proxmox.com>

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
 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





  reply	other threads:[~2023-01-02 12:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-02 12:36 [pve-devel] [PATCH manager/storage] fix #4289: wait for backup verification to finish before " Christoph Heiss
2023-01-02 12:36 ` Christoph Heiss [this message]
2023-01-02 12:36 ` [pve-devel] [PATCH storage] fix #4289: pbs: " Christoph Heiss
2023-01-04 10:50   ` Fiona Ebner
2023-01-10 11:11     ` Christoph Heiss
2023-01-10 12:34       ` Fiona Ebner
2023-01-10 12:44         ` Christoph Heiss
     [not found]           ` <159837ba-f916-7b03-2cab-8e486b38b6bb@proxmox.com>
2023-01-10 13:21             ` 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=20230102123633.2493599-2-c.heiss@proxmox.com \
    --to=c.heiss@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal