all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Jakob Klocker <j.klocker@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Jakob Klocker <j.klocker@proxmox.com>
Subject: [PATCH pve-storage 3/9] storage: add `unknown` flag to parse_config
Date: Fri, 31 Jul 2026 17:36:11 +0200	[thread overview]
Message-ID: <20260731153617.358265-4-j.klocker@proxmox.com> (raw)
In-Reply-To: <20260731153617.358265-1-j.klocker@proxmox.com>

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 <j.klocker@proxmox.com>
---
 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




  parent reply	other threads:[~2026-07-31 15:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31 15:36 [PATCH manager/storage 0/9] storage: plugins: display failed and outdated storage plugins in the GUI Jakob Klocker
2026-07-31 15:36 ` [PATCH pve-storage 1/9] storage: drop unused variable in storage_info Jakob Klocker
2026-07-31 15:36 ` [PATCH pve-storage 2/9] storage: add `plugin-url` to built-in plugins Jakob Klocker
2026-07-31 15:36 ` Jakob Klocker [this message]
2026-07-31 15:36 ` [PATCH pve-storage 4/9] storage: plugins: cache and classify custom storage plugins Jakob Klocker
2026-07-31 15:36 ` [PATCH pve-storage 5/9] storage: expose plugin metadata in storage status Jakob Klocker
2026-07-31 15:36 ` [PATCH pve-manager 6/9] cluster: backend: include storages with unloadable plugins Jakob Klocker
2026-07-31 15:36 ` [PATCH pve-manager 7/9] www: storage: show plugin state/external/url in StatusView Jakob Klocker
2026-07-31 15:36 ` [PATCH pve-manager 8/9] www: storage: distinguish failed/outdated storage plugins in resource tree Jakob Klocker
2026-07-31 15:36 ` [PATCH pve-manager 9/9] www: storage: display custom summary for failed plugins Jakob Klocker

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=20260731153617.358265-4-j.klocker@proxmox.com \
    --to=j.klocker@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal