[pve-devel] [PATCH qemu-server] Make snapshot_prepare and snapshot_commit proper subs

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Feb 22 14:29:28 CET 2016


---
 PVE/QemuServer.pm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index aad13bd..bf2c480 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5942,7 +5942,7 @@ my $snapshot_save_vmstate = sub {
     $snap->{machine} = get_current_qemu_machine($vmid);
 };
 
-my $snapshot_prepare = sub {
+sub snapshot_prepare {
     my ($vmid, $snapname, $save_vmstate, $comment) = @_;
 
     my $snap;
@@ -5982,9 +5982,9 @@ my $snapshot_prepare = sub {
     lock_config($vmid, $updatefn);
 
     return $snap;
-};
+}
 
-my $snapshot_commit = sub {
+sub snapshot_commit {
     my ($vmid, $snapname) = @_;
 
     my $updatefn = sub {
@@ -6016,7 +6016,7 @@ my $snapshot_commit = sub {
     };
 
     lock_config($vmid, $updatefn);
-};
+}
 
 sub snapshot_rollback {
     my ($vmid, $snapname) = @_;
@@ -6165,7 +6165,7 @@ sub qga_check_running {
 sub snapshot_create {
     my ($vmid, $snapname, $save_vmstate, $comment) = @_;
 
-    my $snap = &$snapshot_prepare($vmid, $snapname, $save_vmstate, $comment);
+    my $snap = snapshot_prepare($vmid, $snapname, $save_vmstate, $comment);
 
     $save_vmstate = 0 if !$snap->{vmstate}; # vm is not running
 
@@ -6241,7 +6241,7 @@ sub snapshot_create {
 	die $err;
     }
 
-    &$snapshot_commit($vmid, $snapname);
+    snapshot_commit($vmid, $snapname);
 }
 
 # Note: $drivehash is only set when called from snapshot_create.
-- 
2.1.4





More information about the pve-devel mailing list