[pve-devel] [PATCH] this commit:

Stefan Priebe s.priebe at profihost.ag
Sun Dec 21 21:04:13 CET 2014


commit 1c0c1c17b020710fd841c399c1e147ccc10007cd
Author: Wolfgang Link <wolfgang at linksystems.org>
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 <wolfgang at linksystems.org>

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 <s.priebe at profihost.ag>
---
 PVE/QemuServer.pm |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 44b192a..22de361 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3753,11 +3753,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);
-- 
1.7.10.4




More information about the pve-devel mailing list