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

Thomas Lamprecht t.lamprecht at proxmox.com
Wed May 8 13:58:21 CEST 2019


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(-)

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";
-- 
2.20.1





More information about the pve-devel mailing list