]> git.proxmox.com Git - pve-container.git/commitdiff
VZDump: implement stopwait
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 1 Dec 2016 11:44:34 +0000 (12:44 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 2 Dec 2016 10:48:33 +0000 (11:48 +0100)
This was missing in pve-container, qemu-server does it already.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/VZDump/LXC.pm

index 81f25884da12134a3ca1acde53be956a3ff12fe1..46b5bd2df916a8ac2b5910627784273132889b20 100644 (file)
@@ -248,7 +248,10 @@ sub copy_data_phase2 {
 sub stop_vm {
     my ($self, $task, $vmid) = @_;
 
-    $self->cmd("lxc-stop -n $vmid");
+    my $opts = $self->{vzdump}->{opts};
+    my $timeout = $opts->{stopwait} * 60;
+
+    $self->cmd("lxc-stop -n $vmid -t $timeout");
 
     # make sure container is stopped
     $self->cmd("lxc-wait -n $vmid -s STOPPED");