From 5a08fb9c8b75fe3259adf648c74e3686d6405903 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 21 Oct 2021 08:23:08 +0200 Subject: [PATCH] config properties: refactor skipping internal options to declarative Signed-off-by: Thomas Lamprecht --- PVE/QemuServer.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index b99070d7..e7204c7b 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -2111,9 +2111,16 @@ sub verify_usb_device { sub json_config_properties { my $prop = shift; + my $skip_json_config_opts = { + parent => 1, + snaptime => 1, + vmstate => 1, + runningmachine => 1, + runningcpu => 1, + }; + foreach my $opt (keys %$confdesc) { - next if $opt eq 'parent' || $opt eq 'snaptime' || $opt eq 'vmstate' || - $opt eq 'runningmachine' || $opt eq 'runningcpu'; + next if $skip_json_config_opts->{$opt}; $prop->{$opt} = $confdesc->{$opt}; }