[pve-devel] [PATCH v5 container 1/2] vzdump: add reason for mountpoint backup inclusion
Aaron Lauterer
a.lauterer at proxmox.com
Wed May 6 11:57:23 CEST 2020
Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
nothing changed to previous series'
src/PVE/LXC/Config.pm | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
index dcc8755..34f657a 100644
--- a/src/PVE/LXC/Config.pm
+++ b/src/PVE/LXC/Config.pm
@@ -49,13 +49,23 @@ sub cfs_config_path {
sub mountpoint_backup_enabled {
my ($class, $mp_key, $mountpoint) = @_;
- return 1 if $mp_key eq 'rootfs';
-
- return 0 if $mountpoint->{type} ne 'volume';
-
- return 1 if $mountpoint->{backup};
-
- return 0;
+ my $enabled;
+ my $reason;
+
+ if ($mp_key eq 'rootfs') {
+ $enabled = 1;
+ $reason = 'rootfs';
+ } elsif ($mountpoint->{type} ne 'volume') {
+ $enabled = 0;
+ $reason = 'not a volume';
+ } elsif ($mountpoint->{backup}) {
+ $enabled = 1;
+ $reason = 'enabled';
+ } else {
+ $enabled = 0;
+ $reason = 'disabled';
+ }
+ return wantarray ? ($enabled, $reason) : $enabled;
}
sub has_feature {
--
2.20.1
More information about the pve-devel
mailing list