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 0E0BB1FF0ED for ; Fri, 31 Jul 2026 17:36:38 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 9B15E21557; Fri, 31 Jul 2026 17:36:37 +0200 (CEST) From: Jakob Klocker To: pve-devel@lists.proxmox.com Subject: [PATCH pve-storage 3/9] storage: add `unknown` flag to parse_config Date: Fri, 31 Jul 2026 17:36:11 +0200 Message-ID: <20260731153617.358265-4-j.klocker@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260731153617.358265-1-j.klocker@proxmox.com> References: <20260731153617.358265-1-j.klocker@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 AWL -0.668 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: 6MQNGK3OITQOCWJAVNICSJIULNA5SNAE X-Message-ID-Hash: 6MQNGK3OITQOCWJAVNICSJIULNA5SNAE X-MailFrom: jklocker@dev.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 CC: Jakob Klocker X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: While the base class provides an `unknown` flag it wasn't possible to get unknown storages through the storage parse_config function. With the added flag it is now possible to access these. Signed-off-by: Jakob Klocker --- src/PVE/Storage.pm | 6 +++++- src/PVE/Storage/Plugin.pm | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/PVE/Storage.pm b/src/PVE/Storage.pm index 96579a4..4efc3de 100755 --- a/src/PVE/Storage.pm +++ b/src/PVE/Storage.pm @@ -230,7 +230,11 @@ my $allowed_qemu_blockdev_options = { # PVE::Storage utility functions sub config { - return cfs_read_file("storage.cfg"); + my ($allow_unknown) = @_; + return cfs_read_file("storage.cfg") if !$allow_unknown; + + my $raw = PVE::Cluster::get_config("storage.cfg"); + return PVE::Storage::Plugin->parse_config("/etc/pve/storage.cfg", $raw, $allow_unknown); } sub write_config { diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm index 4f69f9b..9d79fad 100644 --- a/src/PVE/Storage/Plugin.pm +++ b/src/PVE/Storage/Plugin.pm @@ -557,9 +557,9 @@ sub encode_value { } sub parse_config { - my ($class, $filename, $raw) = @_; + my ($class, $filename, $raw, $unknown) = @_; - my $cfg = $class->SUPER::parse_config($filename, $raw); + my $cfg = $class->SUPER::parse_config($filename, $raw, $unknown); my $ids = $cfg->{ids}; # make sure we have a reasonable 'local:' storage -- 2.47.3