[pve-devel] [PATCH v2 pve-manager 20/22] PVE::Replication - aquire guest_migration_lock during replication

Dietmar Maurer dietmar at proxmox.com
Mon May 29 13:00:12 CEST 2017


> > @@ -388,7 +389,12 @@ my $run_replication = sub {
> >  
> >      $logfunc->($start_time, "$jobcfg->{id}: start replication job") if
> > $logfunc;
> >  
> > -    eval { replicate($jobcfg, $state->{last_sync}, $start_time, $logfunc);
> > };
> > +    eval {
> > +	my $timeout = 2; # do not wait too long - we repeat periodically anyways
> > +	PVE::AbstractConfig::guest_migration_lock(
> 
> shouldn't this be QemuConfig/LXC::Config->migration_lock instead?
> 
> we don't have any direct calls to AbstractConfig anywhere in our code
> base, and we already have the vmtype in the jobcfg anyway.
> 
> if you don't want to add another if / else, we could store a reference
> to the config class in $jobcfg? then we could just use that directly
> wherever we need it.

I guess the correct place would be a new class called PVE::GuestTools ?
But I wanted to avoid adding a new file/class with a single function.




More information about the pve-devel mailing list