[pve-devel] [PATCH 3/3] fix bug #691: vzdump stop backup fixed on zfs
Wolfgang Link
w.link at proxmox.com
Tue Aug 25 13:28:08 CEST 2015
---
src/PVE/VZDump/LXC.pm | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/PVE/VZDump/LXC.pm b/src/PVE/VZDump/LXC.pm
index cb228ca..fc3f03b 100644
--- a/src/PVE/VZDump/LXC.pm
+++ b/src/PVE/VZDump/LXC.pm
@@ -134,6 +134,10 @@ sub prepare {
# fixme: when do we deactivate ??
PVE::Storage::activate_volumes($self->{storecfg}, [$volid]) if $volid;
+ my ($sid, $volname) = PVE::Storage::parse_volume_id($volid, 1);
+
+ my $scfg = PVE::Storage::storage_config($self->{storecfg}, $sid);
+
if ($mode eq 'snapshot') {
die "mode failure - storage does not support snapshots (no volid)\n"
@@ -141,11 +145,6 @@ sub prepare {
die "mode failure - storage does not support snapshots\n"
if !PVE::Storage::volume_has_feature($self->{storecfg}, 'snapshot', $volid);
-
- my ($sid, $volname) = PVE::Storage::parse_volume_id($volid, 1);
-
- my $scfg = PVE::Storage::storage_config($self->{storecfg}, $sid);
-
# we only handle well known types for now, because the storage
# library dos not handle mount/unmount of snapshots
@@ -173,7 +172,14 @@ sub prepare {
if ($mode eq 'stop') {
my $path = PVE::Storage::path($self->{storecfg}, $volid);
- &$loop_mount_image($path, $mountpoint);
+
+ if ($scfg->{type} eq 'zfspool') {
+ $mountpoint = $path;
+ $diskinfo->{no_unmount} = 1;
+ } else {
+ &$loop_mount_image($path, $mountpoint);
+ }
+
$task->{cleanup}->{snapshot_mount} = $mountpoint;
$diskinfo->{dir} = $diskinfo->{mountpoint} = $mountpoint;
} elsif ($mode eq 'suspend') {
--
2.1.4
More information about the pve-devel
mailing list