From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 535191FF0E5 for ; Wed, 15 Jul 2026 14:20:05 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 178572134E; Wed, 15 Jul 2026 14:20:05 +0200 (CEST) From: Dietmar Maurer To: pve-devel@lists.proxmox.com Subject: [PATCH] section config: update schema: drop unusable global properties Date: Wed, 15 Jul 2026 14:19:28 +0200 Message-ID: <20260715121928.3434829-1-dietmar@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 AWL -1.050 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 1.274 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Message-ID-Hash: YELIUIS7INPWTLM3RLQYDBVFXSVAVMDP X-Message-ID-Hash: YELIUIS7INPWTLM3RLQYDBVFXSVAVMDP X-MailFrom: dietmar@zilli.proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: With property isolation, updateSchema() added every global property to the schema, even those that no plugin references in options() and those that are only referenced as fixed. Both get rejected by check_config() on update anyway - as unexpected property, or because fixed parameters cannot be changed - so the schema merely advertised update parameters that can never work. Skip them, like unified mode already does. The required globals stay: the section ID, and the type, which update requests carry so that schema validation can pick the matching variant of same-named per-type properties; check_value() checks it against the section's actual type. Adjust the test fixture that encoded the old behavior. Signed-off-by: Dietmar Maurer --- src/PVE/SectionConfig.pm | 6 ++++++ test/SectionConfig/schema_comparison_test.pl | 10 +++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/PVE/SectionConfig.pm b/src/PVE/SectionConfig.pm index 84ff81a..49ebf67 100644 --- a/src/PVE/SectionConfig.pm +++ b/src/PVE/SectionConfig.pm @@ -655,8 +655,14 @@ sub updateSchema { } } + # the loop above already covered all modifiable properties, optional + # global ones are only usable by a plugin when referenced in its + # options(); so only add the required globals, i.e. the section ID and + # the type, which update requests carry so the matching variant of + # per-type properties can be selected during schema validation for my $opt (keys $propertyList->%*) { next if $props->{$opt}; + next if $propertyList->{$opt}->{optional}; $props->{$opt} = { $propertyList->{$opt}->%* }; } diff --git a/test/SectionConfig/schema_comparison_test.pl b/test/SectionConfig/schema_comparison_test.pl index 3ae8551..f421ed3 100755 --- a/test/SectionConfig/schema_comparison_test.pl +++ b/test/SectionConfig/schema_comparison_test.pl @@ -540,9 +540,9 @@ package OptionalCommonUnused { sub desc($class) { return - "in unified mode, optional default properties that plugins" - . " do not declare in options() are *not* included in updateSchema" - . " - in isolated mode, such properties are included, however"; + "for both unified and isolated mode, optional default properties" + . " that plugins do not declare in options() are *not* included" + . " in updateSchema"; } package OptionalCommonUnused::PluginBase { @@ -719,10 +719,6 @@ package OptionalCommonUnused { type => 'string', optional => 1, }, - 'common' => { - type => 'string', - optional => 1, - }, $SectionConfig::Helpers::UPDATE_SCHEMA_DEFAULT_PROPERTIES->%*, }, }; -- 2.47.3