From: Leo Nunner <l.nunner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v2 container 1/2] cleanup: json config: factor out ignored properties into hash
Date: Wed, 1 Mar 2023 14:27:03 +0100 [thread overview]
Message-ID: <20230301132705.151922-2-l.nunner@proxmox.com> (raw)
In-Reply-To: <20230301132705.151922-1-l.nunner@proxmox.com>
Signed-off-by: Leo Nunner <l.nunner@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
next prev parent reply other threads:[~2023-03-01 13:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-01 13:27 [pve-devel] [PATCH v2 container qemu-server] feature #3937: config: store user in meta property Leo Nunner
2023-03-01 13:27 ` Leo Nunner [this message]
2023-03-01 13:27 ` [pve-devel] [PATCH v2 container 2/2] feature #3937: config: introduce " Leo Nunner
2023-03-01 13:27 ` [pve-devel] [PATCH v2 qemu-server] feature #3937: config: store user in " Leo Nunner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230301132705.151922-2-l.nunner@proxmox.com \
--to=l.nunner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox