The subvolume itself cannot be included if there is a base snapshot
or the command would fail with e.g.

> ERROR: subvolume /mnt/btrfs/images/400/vm-400-disk-0 is not read-only

Signed-off-by: Fiona Ebner <f.eb...@proxmox.com>
---
 src/PVE/Storage/BTRFSPlugin.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/PVE/Storage/BTRFSPlugin.pm b/src/PVE/Storage/BTRFSPlugin.pm
index b0f732b..2e58f60 100644
--- a/src/PVE/Storage/BTRFSPlugin.pm
+++ b/src/PVE/Storage/BTRFSPlugin.pm
@@ -780,7 +780,8 @@ sub volume_export {
     }
     push @$cmd, '--';
     if (ref($with_snapshots) eq 'ARRAY') {
-       push @$cmd, (map { "$path\@$_" } ($with_snapshots // [])->@*), $path;
+       push @$cmd, (map { "$path\@$_" } ($with_snapshots // [])->@*);
+       push @$cmd, $path if !defined($base_snapshot);
     } else {
        dir_glob_foreach(dirname($path), $BTRFS_VOL_REGEX, sub {
            push @$cmd, "$path\@$_[2]" if !(defined($snapshot) && $_[2] eq 
$snapshot);
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to