mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-03 22:20:22 +00:00
fix bug #236: use correct shutdown timeout
This commit is contained in:
parent
858f65fec1
commit
7f4a5b5a6e
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user