[pve-devel] applied: [PATCH container 1/2] vm_stop: remove unused exit_timeout parameter

Thomas Lamprecht t.lamprecht at proxmox.com
Mon May 13 18:08:05 CEST 2019


On 5/8/19 1:58 PM, Thomas Lamprecht wrote:
> No call-site used this parameter, and thus it was dead code,
> remove it not only for cleanup sake but also to make space for a new
> "nokill-after-timeout" parameter, comming in a future patch.
> 
> Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
> ---
>  src/PVE/LXC.pm | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)

applied

> 
> diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
> index f1aa9d7..f8fc37e 100644
> --- a/src/PVE/LXC.pm
> +++ b/src/PVE/LXC.pm
> @@ -1939,7 +1939,7 @@ sub vm_start {
>  # unmount-all step, but post-stop happens after lxc puts the container into the
>  # STOPPED state.
>  sub vm_stop {
> -    my ($vmid, $kill, $shutdown_timeout, $exit_timeout) = @_;
> +    my ($vmid, $kill, $shutdown_timeout) = @_;
>  
>      # Open the container's command socket.
>      my $path = "\0/var/lib/lxc/$vmid/command";
> @@ -1972,13 +1972,7 @@ sub vm_stop {
>  	warn $@ if $@;
>      }
>  
> -    my $result = 1;
> -    my $wait = sub { $result = <$sock>; };
> -    if (defined($exit_timeout)) {
> -	PVE::Tools::run_with_timeout($exit_timeout, $wait);
> -    } else {
> -	$wait->();
> -    }
> +    my $result = <$sock>;
>  
>      return if !defined $result; # monitor is gone and the ct has stopped.
>      die "container did not stop\n";
> 





More information about the pve-devel mailing list