[pve-devel] [PATCH] Add qga freeze in vzdump in snapshot mode

Lindsay Mathieson lindsay.mathieson at gmail.com
Wed Dec 10 08:43:49 CET 2014


This will invoke vss on Windows clients?

Lindsay Mathieson 

-----Original Message-----
From: "Wolfgang Link" <wolfgang at linksystems.org>
Sent: ‎9/‎12/‎2014 8:13 PM
To: "pve-devel at pve.proxmox.com" <pve-devel at pve.proxmox.com>
Subject: [pve-devel] [PATCH] Add qga freeze in vzdump in snapshot mode

it will freeze the filesystem to provide consistents.

Signed-off-by: Wolfgang Link <wolfgang at linksystems.org>
---
 PVE/VZDump/QemuServer.pm |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm
index fd36c69..b9edea1 100644
--- a/PVE/VZDump/QemuServer.pm
+++ b/PVE/VZDump/QemuServer.pm
@@ -286,8 +286,8 @@ sub archive {
     my $resume_on_backup;
 
     my $skiplock = 1;
-
-    if (!PVE::QemuServer::check_running($vmid)) {
+    my $vm_is_running = PVE::QemuServer::check_running($vmid);
+    if (!$vm_is_running) {
 	eval {
 	    $self->loginfo("starting kvm to execute backup task");
 	    PVE::QemuServer::vm_start($self->{storecfg}, $vmid, undef, 
@@ -380,8 +380,22 @@ sub archive {
 
 	$qmpclient->queue_cmd($vmid, $add_fd_cb, 'getfd', 
 			      fd => $outfileno, fdname => "backup");
+
+	if ($self->{vmlist}->{$vmid}->{agent} && $vm_is_running){
+	    eval {PVE::QemuServer::vm_mon_cmd($vmid,"guest-fsfreeze-freeze");};
+	    if (my $err = $@) {
+		$self->logerr($err);
+	    }  
+	}
+	
 	$qmpclient->queue_execute();
 
+	if ($self->{vmlist}->{$vmid}->{agent} && $vm_is_running ){
+	    eval {PVE::QemuServer::vm_mon_cmd($vmid,"guest-fsfreeze-thaw");};
+	    if (my $err = $@) {
+		$self->logerr($err);
+	    }
+	}
 	die $qmpclient->{errors}->{$vmid} if $qmpclient->{errors}->{$vmid};    
 
 	if ($cpid) {
-- 
1.7.10.4

_______________________________________________
pve-devel mailing list
pve-devel at pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.proxmox.com/pipermail/pve-devel/attachments/20141210/b8d2b1b4/attachment.htm>


More information about the pve-devel mailing list