[pve-devel] applied: [PATCH v3 guest-common 2/2] fix #1291: implement remove_vmid_jobs for ReplicationConfig

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Sep 4 16:36:50 CEST 2019


On 01.07.19 15:43, Christian Ebner wrote:
> Allows to remove replication jobs from the config based on the vmid.
> 
> Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
> ---
>  PVE/ReplicationConfig.pm | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/PVE/ReplicationConfig.pm b/PVE/ReplicationConfig.pm
> index d597799..e58597e 100644
> --- a/PVE/ReplicationConfig.pm
> +++ b/PVE/ReplicationConfig.pm
> @@ -258,6 +258,20 @@ sub delete_job {
>      lock($code);
>  }
>  
> +sub remove_vmid_jobs {
> +    my ($vmid) = @_;
> +
> +    my $code = sub {
> +	my $cfg = __PACKAGE__->new();
> +	foreach my $id (keys %{$cfg->{ids}}) {
> +	    delete $cfg->{ids}->{$id} if ($cfg->{ids}->{$id}->{guest} == $vmid);
> +	}
> +	$cfg->write();
> +    };
> +
> +    lock($code);
> +}
> +
>  sub swap_source_target_nolock {
>      my ($jobid) = @_;
>  
> 

applied, thanks!




More information about the pve-devel mailing list