use PVE::Storage::BTRFSPlugin;
# Storage API version. Increment it on changes in storage API interface.
-use constant APIVER => 9;
+use constant APIVER => 10;
# Age is the number of versions we're backward compatible with.
# This is like having 'current=APIVER' and age='APIAGE' in libtool,
# see https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html
-use constant APIAGE => 0;
+use constant APIAGE => 1;
# load standard plugins
PVE::Storage::DirPlugin->register();
return PVE::Storage::Plugin::file_size_info($filename, $timeout);
}
-sub get_volume_notes {
- my ($cfg, $volid, $timeout) = @_;
+sub get_volume_attribute {
+ my ($cfg, $volid, $attribute) = @_;
my ($storeid, $volname) = parse_volume_id($volid);
my $scfg = storage_config($cfg, $storeid);
my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
- return $plugin->get_volume_notes($scfg, $storeid, $volname, $timeout);
+ return $plugin->get_volume_attribute($scfg, $storeid, $volname, $attribute);
}
-sub update_volume_notes {
- my ($cfg, $volid, $notes, $timeout) = @_;
+sub update_volume_attribute {
+ my ($cfg, $volid, $attribute, $value) = @_;
my ($storeid, $volname) = parse_volume_id($volid);
my $scfg = storage_config($cfg, $storeid);
my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
- $plugin->update_volume_notes($scfg, $storeid, $volname, $notes, $timeout);
+ return $plugin->update_volume_attribute($scfg, $storeid, $volname, $attribute, $value);
}
sub volume_size_info {
}
}
-sub volume_snapshot_list {
+sub volume_snapshot_info {
my ($cfg, $volid) = @_;
- my ($storeid, $volname) = parse_volume_id($volid, 1);
- if ($storeid) {
- my $scfg = storage_config($cfg, $storeid);
- my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
- return $plugin->volume_snapshot_list($scfg, $storeid, $volname);
- } elsif ($volid =~ m|^(/.+)$| && -e $volid) {
- die "send file/device '$volid' is not possible\n";
- } else {
- die "unable to parse volume ID '$volid'\n";
- }
- # return an empty array if dataset does not exist.
+ my ($storeid, $volname) = parse_volume_id($volid);
+ my $scfg = storage_config($cfg, $storeid);
+ my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
+ return $plugin->volume_snapshot_info($scfg, $storeid, $volname);
}
sub get_image_dir {
if ($keep->{'keep-all'} || scalar(@positive_opts) == 0) {
foreach my $prune_entry (@{$backup_group}) {
+ # preserve additional information like 'protected'
+ next if $prune_entry->{mark} && $prune_entry->{mark} ne 'remove';
$prune_entry->{mark} = 'keep';
}
return;