[pve-devel] [PATCH manager 3/3] replication: check for source == target on job creation

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue Aug 11 14:31:11 CEST 2020


and die.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 PVE/API2/ReplicationConfig.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/PVE/API2/ReplicationConfig.pm b/PVE/API2/ReplicationConfig.pm
index 4a25a92b..aea3bff3 100644
--- a/PVE/API2/ReplicationConfig.pm
+++ b/PVE/API2/ReplicationConfig.pm
@@ -131,6 +131,9 @@ __PACKAGE__->register_method ({
 
 	$param->{source} //= $source;
 
+	die "Source and target must not be identical\n"
+	    if $param->{target} eq $source;
+
 	my $guest_class = $PVE::API2::Replication::lookup_guest_class->($guest_info->{type});
 	my $guest_conf = $guest_class->load_config($guest, $source);
 	my $rep_volumes = $guest_class->get_replicatable_volumes(PVE::Storage::config(), $guest, $guest_conf, 0, 0);
-- 
2.20.1






More information about the pve-devel mailing list