]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/GlusterfsPlugin.pm
path: corretly implement path to snapshots
[pve-storage.git] / PVE / Storage / GlusterfsPlugin.pm
index 890efcf832c7b3e37f5208bbe19d89e3e55a9c02..7a8c82fbee81a9f9b2153bb18847038855675b2d 100644 (file)
@@ -191,9 +191,15 @@ my $find_free_diskname = sub {
 };
 
 sub path {
-    my ($class, $scfg, $volname, $storeid) = @_;
+    my ($class, $scfg, $volname, $storeid, $snapname) = @_;
 
-    my ($vtype, $name, $vmid) = $class->parse_volname($volname);
+    my ($vtype, $name, $vmid, undef, undef, $isBase, $format) =
+       $class->parse_volname($volname);
+
+    # Note: qcow2/qed has internal snapshot, so path is always
+    # the same (with or without snapshot => same file).
+    die "can't snapshot this image format\n" 
+       if defined($snapname) && $format !~ m/^(qcow2|qed)$/;
 
     my $path = undef;
     if ($vtype eq 'images') {