From 6fab033c3c639d13078d9776d91bc7648a673fa8 Mon Sep 17 00:00:00 2001 From: Stefan Priebe Date: Sun, 21 Dec 2014 21:04:13 +0100 Subject: [PATCH] this commit: commit 1c0c1c17b020710fd841c399c1e147ccc10007cd Author: Wolfgang Link Date: Wed Nov 26 11:11:40 2014 +0100 shutdown by Qemu Guest Agent if the agent flag in the config is set Important: "guest-shutdown" returns only by error a message. Signed-off-by: Wolfgang Link breaks live migration as it always tries to load the vm config - even in case of $nocheck. Also it double loads the config ($conf && $config) Signed-off-by: Stefan Priebe --- PVE/QemuServer.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 4840c739..cb84f42c 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -3721,11 +3721,10 @@ sub vm_stop { } $timeout = 60 if !defined($timeout); - my $config = load_config($vmid); eval { if ($shutdown) { - if ($config->{agent}) { + if (!$nocheck && $conf->{agent}) { vm_qmp_command($vmid, { execute => "guest-shutdown" }, $nocheck); } else { vm_qmp_command($vmid, { execute => "system_powerdown" }, $nocheck);