Skip to content

Commit 03614a8

Browse files
Fabio Fantoni via pve-develfoxmox
authored andcommitted
fix vm shutdown when agent conf is enabled but is not running in the vm
Checking only vm configuration for choose the shutdown method causes it to always fail, after reaching the timeout, if the qemu agent option in the vm configuration is enabled but the agent is not installed and active in the guest. As I seen in the windows vm the agent also crashes in some cases, so shutdown don't fail only if qemu guest agent is not installed or not started. Added check that agent is active when choosing agent shutdown method to avoid certain shutdown failure in those cases. Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz> [FE: do not set flag to suppress warning when agent is not running] Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
1 parent fa7e486 commit 03614a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PVE/QemuServer.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6349,7 +6349,7 @@ sub _do_vm_stop {
63496349

63506350
eval {
63516351
if ($shutdown) {
6352-
if (defined($conf) && get_qga_key($conf, 'enabled')) {
6352+
if (defined($conf) && get_qga_key($conf, 'enabled') && qga_check_running($vmid)) {
63536353
mon_cmd($vmid, "guest-shutdown", timeout => $timeout);
63546354
} else {
63556355
mon_cmd($vmid, "system_powerdown");

0 commit comments

Comments
 (0)