[pve-devel] [PATCH] Fix in PVE::QemuServer::snapshot_create

Wolfgang Link wolfgang at linksystems.org
Wed Dec 3 15:40:33 CET 2014


remove the freezefs flag.
If Qemu Guest Agent flag is set in config the vm filesystem will always be frozen.

also remove param freezefs in PVE::API2 snapshot,
because there is no use for it.

Signed-off-by: Wolfgang Link <wolfgang at linksystems.org>
---
 PVE/API2/Qemu.pm  |    7 +------
 PVE/QemuServer.pm |    8 ++++----
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 0787074..6cbfa7a 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -2853,11 +2853,6 @@ __PACKAGE__->register_method({
 		type => 'boolean',
 		description => "Save the vmstate",
 	    },
-	    freezefs => {
-		optional => 1,
-		type => 'boolean',
-		description => "Freeze the filesystem",
-	    },
 	    description => {
 		optional => 1,
 		type => 'string',
@@ -2888,7 +2883,7 @@ __PACKAGE__->register_method({
 	my $realcmd = sub {
 	    PVE::Cluster::log_msg('info', $authuser, "snapshot VM $vmid: $snapname");
 	    PVE::QemuServer::snapshot_create($vmid, $snapname, $param->{vmstate},
-					     $param->{freezefs}, $param->{description});
+					     , $param->{description});
 	};
 
 	return $rpcenv->fork_worker('qmsnapshot', $vmid, $authuser, $realcmd);
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index eb15f9c..b6245c3 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -4876,11 +4876,11 @@ my $savevm_wait = sub {
 };
 
 sub snapshot_create {
-    my ($vmid, $snapname, $save_vmstate, $freezefs, $comment) = @_;
+    my ($vmid, $snapname, $save_vmstate, $comment) = @_;
 
     my $snap = &$snapshot_prepare($vmid, $snapname, $save_vmstate, $comment);
 
-    $freezefs = $save_vmstate = 0 if !$snap->{vmstate}; # vm is not running
+    $save_vmstate = 0 if !$snap->{vmstate}; # vm is not running
 
     my $drivehash = {};
 
@@ -4888,7 +4888,7 @@ sub snapshot_create {
 
     my $config = load_config($vmid); 
        
-    if ($running && $freezefs && $config->{agent}) {
+    if ($running && $config->{agent}) {
 	eval { vm_mon_cmd($vmid, "guest-fsfreeze-freeze"); };
 	warn "guest-fsfreeze-freeze problems - $@" if $@;
     }
@@ -4926,7 +4926,7 @@ sub snapshot_create {
 	eval { vm_mon_cmd($vmid, "savevm-end")  };
 	warn $@ if $@;
 
-	if ($freezefs && $config->{agent}) {
+	if ($config->{agent}) {
 	    eval { vm_mon_cmd($vmid, "guest-fsfreeze-thaw"); }; 
 	    warn "guest-fsfreeze-thaw problems - $@" if $@;
 	}
-- 
1.7.10.4




More information about the pve-devel mailing list