config properties: refactor skipping internal options to declarative

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-10-21 08:23:08 +02:00
parent 3d0ee5d41c
commit 5a08fb9c8b

View File

@ -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};
}