[pve-devel] [PATCH pve-guest-common 1/5] PVE::ReplicationConfig::find_local_replication_job - new helper

Wolfgang Link w.link at proxmox.com
Tue Jun 20 12:09:53 CEST 2017



On 06/20/2017 10:50 AM, Dietmar Maurer wrote:
> Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
> ---
>  PVE/ReplicationConfig.pm | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/PVE/ReplicationConfig.pm b/PVE/ReplicationConfig.pm
> index 845d9c3..1e813dd 100644
> --- 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};

Here we lose the jobid information.
What we use later in the run_replication

> +	return $data if $data->{type} eq 'local' &&
> +	    $data->{guest} == $vmid && $data->{target} eq $target;
> +    }
> +
> +    return undef;
> +}
> +
>  sub delete_job {
>      my ($jobid) = @_;
>
>




More information about the pve-devel mailing list