[pve-devel] [PATCH v2 pve-container 2/3] vzdump:lxc: sync and skip journal in snapshot mode

Wolfgang Bumiller w.bumiller at proxmox.com
Fri Sep 25 14:08:01 CEST 2015


We now perform a 'sync' after 'lxc-freeze' and before
creating the snapshot, since we now mount snapshots with
'-o noload' which skips the journal entirely.
---
 src/PVE/LXC.pm | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index c01b401..c5a1409 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1719,20 +1719,19 @@ sub snapshot_create {
 
     my $conf = load_config($vmid);
 
-    my $cmd = "/usr/bin/lxc-freeze -n $vmid";
     my $running = check_running($vmid);
     eval {
 	if ($running) {
-	    PVE::Tools::run_command($cmd);
+	    PVE::Tools::run_command(['/usr/bin/lxc-freeze', '-n', $vmid]);
+	    PVE::Tools::run_command(['/bin/sync']);
 	};
 
 	my $storecfg = PVE::Storage::config();
 	my $rootinfo = parse_ct_mountpoint($conf->{rootfs});
 	my $volid = $rootinfo->{volume};
 
-	$cmd = "/usr/bin/lxc-unfreeze -n $vmid";
 	if ($running) {
-	    PVE::Tools::run_command($cmd);
+	    PVE::Tools::run_command(['/usr/bin/lxc-unfreeze', '-n', $vmid]);
 	};
 
 	PVE::Storage::volume_snapshot($storecfg, $volid, $snapname);
-- 
2.1.4





More information about the pve-devel mailing list