[pve-devel] [PATCH 2/2] PVE::ReplicationState - new helper replication_snapshot_name()

Dietmar Maurer dietmar at proxmox.com
Tue Jun 6 11:57:07 CEST 2017


Changed replication snapshot naming to __replicate_<jobid>_<lastsync>__
to avoid conflicts with normal snapshot names.

Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 PVE/ReplicationState.pm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/PVE/ReplicationState.pm b/PVE/ReplicationState.pm
index d0eaf80..be5cf5f 100644
--- a/PVE/ReplicationState.pm
+++ b/PVE/ReplicationState.pm
@@ -83,4 +83,13 @@ sub write_job_state {
     PVE::GuestHelpers::guest_migration_lock($vmid, undef, $code);
 }
 
+sub replication_snapshot_name {
+    my ($jobid, $last_sync) = @_;
+
+    my $prefix = "__replicate_${jobid}_";
+    my $snapname = "${prefix}${last_sync}__";
+
+    wantarray ? ($prefix, $snapname) : $snapname;
+}
+
 1;
-- 
2.11.0




More information about the pve-devel mailing list