projects
/
pve-guest-common.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c475e16
)
PVE::ReplicationConfig::find_local_replication_job - new helper
author
Dietmar Maurer
<dietmar@proxmox.com>
Mon, 19 Jun 2017 14:06:55 +0000
(16:06 +0200)
committer
Dietmar Maurer
<dietmar@proxmox.com>
Tue, 20 Jun 2017 05:13:00 +0000
(07:13 +0200)
PVE/ReplicationConfig.pm
patch
|
blob
|
blame
|
history
diff --git
a/PVE/ReplicationConfig.pm
b/PVE/ReplicationConfig.pm
index 845d9c35efa510d715717bf02472951479aef4ba..1e813dd55dc57af7a5a2a0b90e62cefeb134b2a4 100644
(file)
--- a/
PVE/ReplicationConfig.pm
+++ b/
PVE/ReplicationConfig.pm
@@
-209,6
+209,19
@@
sub check_for_existing_jobs {
return undef;
}
+sub find_local_replication_job {
+ my ($cfg, $vmid, $target) = @_;
+
+ foreach my $id (keys %{$cfg->{ids}}) {
+ my $data = $cfg->{ids}->{$id};
+
+ return $data if $data->{type} eq 'local' &&
+ $data->{guest} == $vmid && $data->{target} eq $target;
+ }
+
+ return undef;
+}
+
sub delete_job {
my ($jobid) = @_;