[pve-devel] [PATCH v2 container 1/2] cleanup: json config: factor out ignored properties into hash

Leo Nunner l.nunner at proxmox.com
Wed Mar 1 14:27:03 CET 2023


Signed-off-by: Leo Nunner <l.nunner at proxmox.com>
---
 src/PVE/LXC/Config.pm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
index af25a96..aca72ae 100644
--- a/src/PVE/LXC/Config.pm
+++ b/src/PVE/LXC/Config.pm
@@ -1182,8 +1182,13 @@ sub check_type {
 sub json_config_properties {
     my ($class, $prop) = @_;
 
+    my $skip_json_config_opts = {
+	parent => 1,
+	snaptime => 1,
+    };
+
     foreach my $opt (keys %$confdesc) {
-	next if $opt eq 'parent' || $opt eq 'snaptime';
+	next if $skip_json_config_opts->{$opt};
 	next if $prop->{$opt};
 	$prop->{$opt} = $confdesc->{$opt};
     }
-- 
2.30.2






More information about the pve-devel mailing list