From: Thomas Lamprecht Date: Fri, 18 Jun 2021 16:02:21 +0000 (+0200) Subject: setup: fix calling clone hook with weird params X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=6ef3baef6e29ffbcd79e929fc15089efed5cc7e7;p=pve-container.git setup: fix calling clone hook with weird params $clone has no use and what the interface constraints on $conf vs. $self->{conf} really are is nowhere documented, so just use $conf for now, to at least use only one thing (and avoid the highly confusing case where the signature suggests that $conf is used, so when one would pass a to $self->{conf} unrelated $conf it would not work) Signed-off-by: Thomas Lamprecht --- diff --git a/src/PVE/LXC/Setup.pm b/src/PVE/LXC/Setup.pm index bcb995d..cf72b03 100644 --- a/src/PVE/LXC/Setup.pm +++ b/src/PVE/LXC/Setup.pm @@ -355,13 +355,9 @@ sub pre_start_hook { sub post_clone_hook { my ($self, $conf) = @_; - my $clone = 1; - - my $code = sub { - $self->{plugin}->post_clone_hook($self->{conf}, $clone); - }; - $self->protected_call($code); - + $self->protected_call(sub { + $self->{plugin}->post_clone_hook($conf); + }); } sub post_create_hook {