On 4/29/20 10:52 AM, Fabian Grünbichler wrote: > Signed-off-by: Fabian Grünbichler <f.gruenbich...@proxmox.com> > --- > alternatively we could re-use 'cfs_lock_domain', which is currently > only used by HA and was intended as general-purpose cfs_lock wrapper.. > I'd shorten the firewall- prefix to fw- in that case though. >
Initially I was more for using the domain one here, but looking at the lock helper patch in firewall and the other lock code in PVE::Cluster made me think that this fits actually quite well. applied, thanks! > domain-fw-host-$foo might be more confusing to end users though, as it's > pretty visible in error messages. > > data/PVE/Cluster.pm | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/data/PVE/Cluster.pm b/data/PVE/Cluster.pm > index 068d626..b4de989 100644 > --- a/data/PVE/Cluster.pm > +++ b/data/PVE/Cluster.pm > @@ -659,6 +659,14 @@ sub cfs_lock_authkey { > $cfs_lock->('authkey', $timeout, $code, @param); > } > > +sub cfs_lock_firewall { > + my ($scope, $timeout, $code, @param) = @_; > + > + my $lockid = "firewall-$scope"; > + > + $cfs_lock->($lockid, $timeout, $code, @param); > +} > + > my $log_levels = { > "emerg" => 0, > "alert" => 1, > _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel