X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=PVE%2FStorage.pm;h=223fbb5b4e94cfc6fe3823507dd234c116012095;hb=9a4c0e84713d154539accad94c421a160c211e24;hp=5d389bef8986d14136562436ba2c17a1eb5b6ea4;hpb=dc992e7b89467fe0b3888c6b15aa1ddf053eeec1;p=pve-storage.git diff --git a/PVE/Storage.pm b/PVE/Storage.pm index 5d389be..223fbb5 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -41,11 +41,11 @@ use PVE::Storage::PBSPlugin; 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(); @@ -215,24 +215,24 @@ sub file_size_info { 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 { @@ -1663,6 +1663,8 @@ sub prune_mark_backup_group { 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;