[pve-devel] [PATCH qemu-server] fix #1779: vzdump: ensure guest-fsfreeze-thaw is called on error

Wolfgang Bumiller w.bumiller at proxmox.com
Wed May 23 11:07:39 CEST 2018


as QMPClient's queue_execute can throw an error

Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
 PVE/VZDump/QemuServer.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm
index 42680f8..70abe99 100644
--- a/PVE/VZDump/QemuServer.pm
+++ b/PVE/VZDump/QemuServer.pm
@@ -416,16 +416,18 @@ sub archive {
 		$self->logerr($err);
 	    }
 	}
 
-	$qmpclient->queue_execute();
+	eval { $qmpclient->queue_execute() };
+	my $qmperr = $@;
 
 	if ($agent_running){
 	    eval { PVE::QemuServer::vm_mon_cmd($vmid, "guest-fsfreeze-thaw"); };
 	    if (my $err = $@) {
 		$self->logerr($err);
 	    }
 	}
+	die $qmperr if $qmperr;
 	die $qmpclient->{errors}->{$vmid} if $qmpclient->{errors}->{$vmid};
 
 	if ($cpid) {
 	    POSIX::close($outfileno) == 0 ||
-- 
2.11.0





More information about the pve-devel mailing list