From: Christoph Heiss <c.heiss@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [RFC PATCH pve-manager 6/6] vzdump: Only set protected attribute if not already done
Date: Wed, 18 Jan 2023 11:49:03 +0100 [thread overview]
Message-ID: <20230118104903.441554-7-c.heiss@proxmox.com> (raw)
In-Reply-To: <20230118104903.441554-1-c.heiss@proxmox.com>
This works together with the new mechanism for PBS backups which set the
backup as protected directly on finishing it.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
PVE/VZDump.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index a04837e7..6c9fff7f 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -1095,7 +1095,8 @@ sub exec_backup_task {
}
}
- if ($opts->{protected}) {
+ my $already_protected = PVE::Storage::get_volume_attribute($cfg, $volid, 'protected');
+ if ($opts->{protected} && !$already_protected) {
debugmsg('info', "marking backup as protected", $logfd);
eval { PVE::Storage::update_volume_attribute($cfg, $volid, 'protected', 1) };
die "unable to set protected flag - $@\n" if $@;
--
2.34.1
prev parent reply other threads:[~2023-01-18 10:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 10:48 [pbs-devel] [RFC PATCH proxmox-backup{, -qemu}, pve-{qemu, manager}, qemu-server 0/6] fix #4289: Set protected flag on backup creation Christoph Heiss
2023-01-18 10:48 ` [pbs-devel] [RFC PATCH proxmox-backup 1/6] api2: Add `protected` parameter to `finish` endpoint Christoph Heiss
2023-01-18 11:12 ` Fabian Grünbichler
2023-01-18 10:48 ` [pbs-devel] [RFC PATCH proxmox-backup 2/6] client: Add `--protected` CLI flag to backup command Christoph Heiss
2023-01-18 11:13 ` Fabian Grünbichler
2023-01-18 11:50 ` Christoph Heiss
2023-01-18 10:49 ` [pbs-devel] [RFC PATCH proxmox-backup-qemu 3/6] api: Supply `protected` parameter to the `finish` API call Christoph Heiss
2023-01-18 10:49 ` [pbs-devel] [RFC PATCH pve-qemu 4/6] pve: Add patch to support new proxmox-backup-qemu API Christoph Heiss
2023-01-18 10:49 ` [pbs-devel] [RFC PATCH qemu-server 5/6] vzdump: Set protected flag on backup start if supported Christoph Heiss
2023-01-18 10:49 ` Christoph Heiss [this message]
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=20230118104903.441554-7-c.heiss@proxmox.com \
--to=c.heiss@proxmox.com \
--cc=pbs-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