public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH-SERIES storage 0/3] small fixes towards btrfs incremental export/import
@ 2025-02-21 15:41 Fiona Ebner
  2025-02-21 15:41 ` [pve-devel] [PATCH storage 1/3] volume export: fix handling of snapshot list Fiona Ebner
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Fiona Ebner @ 2025-02-21 15:41 UTC (permalink / raw)
  To: pve-devel

I noticed that btrfs incremental export/import does not currently work
when testing Maximiliano's series[0]. While these fixes don't make it
work either, they should make life easier for a future developer
actually tackling that feature.

[0]: https://lore.proxmox.com/pve-devel/20250219111740.200819-1-m.sandoval@proxmox.com/

Fiona Ebner (3):
  volume export: fix handling of snapshot list
  btrfs: volume import: fix check for presence of base snapshot
  btrfs: volume export: fix command for incremental stream

 src/PVE/CLI/pvesm.pm           | 2 +-
 src/PVE/Storage/BTRFSPlugin.pm | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

-- 
2.39.5



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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH storage 1/3] volume export: fix handling of snapshot list
  2025-02-21 15:41 [pve-devel] [PATCH-SERIES storage 0/3] small fixes towards btrfs incremental export/import Fiona Ebner
@ 2025-02-21 15:41 ` Fiona Ebner
  2025-02-21 15:41 ` [pve-devel] [PATCH storage 2/3] btrfs: volume import: fix check for presence of base snapshot Fiona Ebner
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2025-02-21 15:41 UTC (permalink / raw)
  To: pve-devel

The split_list() helper will return a list, and assignment in scalar
context would result in the number of elements, instead of having the
desired array reference, that the BTRFS plugin expects.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/CLI/pvesm.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/CLI/pvesm.pm b/src/PVE/CLI/pvesm.pm
index d308b3d..fd5f788 100755
--- a/src/PVE/CLI/pvesm.pm
+++ b/src/PVE/CLI/pvesm.pm
@@ -308,7 +308,7 @@ __PACKAGE__->register_method ({
 
 	my $with_snapshots = $param->{'with-snapshots'};
 	if (defined(my $list = $param->{'snapshot-list'})) {
-	    $with_snapshots = PVE::Tools::split_list($list);
+	    $with_snapshots = [PVE::Tools::split_list($list)];
 	}
 
 	my $filename = $param->{filename};
-- 
2.39.5



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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH storage 2/3] btrfs: volume import: fix check for presence of base snapshot
  2025-02-21 15:41 [pve-devel] [PATCH-SERIES storage 0/3] small fixes towards btrfs incremental export/import Fiona Ebner
  2025-02-21 15:41 ` [pve-devel] [PATCH storage 1/3] volume export: fix handling of snapshot list Fiona Ebner
@ 2025-02-21 15:41 ` Fiona Ebner
  2025-02-21 15:41 ` [pve-devel] [PATCH storage 3/3] btrfs: volume export: fix command for incremental stream Fiona Ebner
  2025-04-06 19:19 ` [pve-devel] applied: [PATCH-SERIES storage 0/3] small fixes towards btrfs incremental export/import Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2025-02-21 15:41 UTC (permalink / raw)
  To: pve-devel

For a 'raw' volume, the path includes the '/disk.raw' suffix, but the
check expects the containing subvolume directory.

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

diff --git a/src/PVE/Storage/BTRFSPlugin.pm b/src/PVE/Storage/BTRFSPlugin.pm
index cadd9d1..b0f732b 100644
--- a/src/PVE/Storage/BTRFSPlugin.pm
+++ b/src/PVE/Storage/BTRFSPlugin.pm
@@ -822,6 +822,7 @@ sub volume_import {
 
     if (defined($base_snapshot)) {
 	my $path = $class->path($scfg, $volname, $storeid, $base_snapshot);
+	$path = raw_file_to_subvol($path) if $volume_format eq 'raw';
 	die "base snapshot '$base_snapshot' not found - no such directory '$path'\n"
 	    if !path_is_subvolume($path);
     }
-- 
2.39.5



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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH storage 3/3] btrfs: volume export: fix command for incremental stream
  2025-02-21 15:41 [pve-devel] [PATCH-SERIES storage 0/3] small fixes towards btrfs incremental export/import Fiona Ebner
  2025-02-21 15:41 ` [pve-devel] [PATCH storage 1/3] volume export: fix handling of snapshot list Fiona Ebner
  2025-02-21 15:41 ` [pve-devel] [PATCH storage 2/3] btrfs: volume import: fix check for presence of base snapshot Fiona Ebner
@ 2025-02-21 15:41 ` Fiona Ebner
  2025-04-06 19:19 ` [pve-devel] applied: [PATCH-SERIES storage 0/3] small fixes towards btrfs incremental export/import Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2025-02-21 15:41 UTC (permalink / raw)
  To: pve-devel

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.ebner@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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] applied: [PATCH-SERIES storage 0/3] small fixes towards btrfs incremental export/import
  2025-02-21 15:41 [pve-devel] [PATCH-SERIES storage 0/3] small fixes towards btrfs incremental export/import Fiona Ebner
                   ` (2 preceding siblings ...)
  2025-02-21 15:41 ` [pve-devel] [PATCH storage 3/3] btrfs: volume export: fix command for incremental stream Fiona Ebner
@ 2025-04-06 19:19 ` Thomas Lamprecht
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2025-04-06 19:19 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fiona Ebner

Am 21.02.25 um 16:41 schrieb Fiona Ebner:
> I noticed that btrfs incremental export/import does not currently work
> when testing Maximiliano's series[0]. While these fixes don't make it
> work either, they should make life easier for a future developer
> actually tackling that feature.
> 
> [0]: https://lore.proxmox.com/pve-devel/20250219111740.200819-1-m.sandoval@proxmox.com/
> 
> Fiona Ebner (3):
>   volume export: fix handling of snapshot list
>   btrfs: volume import: fix check for presence of base snapshot
>   btrfs: volume export: fix command for incremental stream
> 
>  src/PVE/CLI/pvesm.pm           | 2 +-
>  src/PVE/Storage/BTRFSPlugin.pm | 4 +++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 


applied series, third patch had some context changes that weren't hard to
resolve, thanks!


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-06 19:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-21 15:41 [pve-devel] [PATCH-SERIES storage 0/3] small fixes towards btrfs incremental export/import Fiona Ebner
2025-02-21 15:41 ` [pve-devel] [PATCH storage 1/3] volume export: fix handling of snapshot list Fiona Ebner
2025-02-21 15:41 ` [pve-devel] [PATCH storage 2/3] btrfs: volume import: fix check for presence of base snapshot Fiona Ebner
2025-02-21 15:41 ` [pve-devel] [PATCH storage 3/3] btrfs: volume export: fix command for incremental stream Fiona Ebner
2025-04-06 19:19 ` [pve-devel] applied: [PATCH-SERIES storage 0/3] small fixes towards btrfs incremental export/import Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal