[pve-devel] [FOLLOWUP storage] backup provider: base: document limitation of backup_container() method
Fiona Ebner
f.ebner at proxmox.com
Tue Apr 1 10:26:30 CEST 2025
The backup_container() method is called after forking, so changes to
$self will not be visible in later method calls done by the parent.
Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
src/PVE/BackupProvider/Plugin/Base.pm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/PVE/BackupProvider/Plugin/Base.pm b/src/PVE/BackupProvider/Plugin/Base.pm
index 424feb7..4a35330 100644
--- a/src/PVE/BackupProvider/Plugin/Base.pm
+++ b/src/PVE/BackupProvider/Plugin/Base.pm
@@ -595,11 +595,16 @@ that is made available for the mechanism returned by C<backup_get_mechanism>.
Returns when done backing up. Ideally, the method should log the progress during
backup.
-Note that this function is executed as the ID-mapped root user of the container,
+Note that this method is executed as the ID-mapped root user of the container,
so a potentially unprivileged user. The ID is passed along as part of C<$info>.
Use the C<backup_container_prepare()> method for preparation. For example, to
make credentials available to the potentially unprivileged user.
+Note that changes to C<$self> made during this method will not be visible in
+later method calls. This is because the method is executed in a separate
+execution context after forking. Use the C<backup_container_prepare()> method
+if you need persistent changes to C<$self>.
+
Parameters:
=over
--
2.39.5
More information about the pve-devel
mailing list