fix bug #236: use correct shutdown timeout

This commit is contained in:
Dietmar Maurer 2012-08-21 11:39:17 +02:00
parent 858f65fec1
commit 7f4a5b5a6e

View File

@ -2907,8 +2907,6 @@ sub vm_stop_cleanup {
sub vm_stop {
my ($storecfg, $vmid, $skiplock, $nocheck, $timeout, $shutdown, $force, $keepActive) = @_;
$timeout = 60 if !defined($timeout);
$force = 1 if !defined($force) && !$shutdown;
lock_config($vmid, sub {
@ -2920,8 +2918,14 @@ sub vm_stop {
if (!$nocheck) {
$conf = load_config($vmid);
check_lock($conf) if !$skiplock;
if (!defined($timeout) && $shutdown && $conf->{startup}) {
my $opts = parse_startup($conf->{startup});
$timeout = $opts->{down} if $opts->{down};
}
}
$timeout = 60 if !defined($timeout);
eval {
if ($shutdown) {
$nocheck ? vm_mon_cmd_nocheck($vmid, "system_powerdown") : vm_mon_cmd($vmid, "system_powerdown");