mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-07 18:36:58 +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 {
|
sub vm_stop {
|
||||||
my ($storecfg, $vmid, $skiplock, $nocheck, $timeout, $shutdown, $force, $keepActive) = @_;
|
my ($storecfg, $vmid, $skiplock, $nocheck, $timeout, $shutdown, $force, $keepActive) = @_;
|
||||||
|
|
||||||
$timeout = 60 if !defined($timeout);
|
|
||||||
|
|
||||||
$force = 1 if !defined($force) && !$shutdown;
|
$force = 1 if !defined($force) && !$shutdown;
|
||||||
|
|
||||||
lock_config($vmid, sub {
|
lock_config($vmid, sub {
|
||||||
@ -2920,8 +2918,14 @@ sub vm_stop {
|
|||||||
if (!$nocheck) {
|
if (!$nocheck) {
|
||||||
$conf = load_config($vmid);
|
$conf = load_config($vmid);
|
||||||
check_lock($conf) if !$skiplock;
|
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 {
|
eval {
|
||||||
if ($shutdown) {
|
if ($shutdown) {
|
||||||
$nocheck ? vm_mon_cmd_nocheck($vmid, "system_powerdown") : vm_mon_cmd($vmid, "system_powerdown");
|
$nocheck ? vm_mon_cmd_nocheck($vmid, "system_powerdown") : vm_mon_cmd($vmid, "system_powerdown");
|
||||||
|
Loading…
Reference in New Issue
Block a user