From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id C912E1FF0B7 for ; Fri, 13 Nov 2026 21:35:02 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 54EE621761; Fri, 13 Nov 2026 21:34:07 +0100 (CET) From: "Max R. Carrara" To: pve-devel@lists.proxmox.com Subject: [PATCH pve-storage v5 10/19] api: plugins/storage/plugin: allow plugins to have display names Date: Fri, 13 Nov 2026 21:33:14 +0100 Message-ID: <20261113203330.932813-11-m.carrara@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261113203330.932813-1-m.carrara@proxmox.com> References: <20261113203330.932813-1-m.carrara@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794602031457 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.290 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) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: IA6MNGQQALUM2KZ2ANTC63BACLL2FBGI X-Message-ID-Hash: IA6MNGQQALUM2KZ2ANTC63BACLL2FBGI X-MailFrom: m.carrara@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: Alfonso Kuen , Thomas Ellmenreich , 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: Introduce a new `meta` key in `plugindata()`, stores a hash containing additional / misc. metadata for storage plugins. Right now, only `display-name` exists inside `meta`, allowing third-party plugin authors to give their plugin a proper name. This display name will also be shown in the UI later. Signed-off-by: Max R. Carrara --- src/PVE/API2/Plugins/Storage/Plugin.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/PVE/API2/Plugins/Storage/Plugin.pm b/src/PVE/API2/Plugins/Storage/Plugin.pm index 1b8c35d2..7e602523 100644 --- a/src/PVE/API2/Plugins/Storage/Plugin.pm +++ b/src/PVE/API2/Plugins/Storage/Plugin.pm @@ -45,10 +45,15 @@ my $PLUGIN_METADATA_SCHEMA = { type => 'string', }, }, }, }, + 'display-name' => { + description => "The name of the storage type, if the plugin provides one.", + type => 'string', + optional => 1, + }, origin => { description => "Whether the plugin is shipped with Proxmox VE ('builtin') or" . " installed separately ('custom').", type => 'string', enum => $PLUGIN_ORIGINS, @@ -135,19 +140,26 @@ my sub get_schema_for_plugin : prototype($) ($plugin) { my sub build_plugin_metadata($type) { my $plugin = PVE::Storage::Plugin->lookup($type); my $plugindata = $plugin->plugindata(); - return { + my $metadata = { content => { supported => [sort keys $plugindata->{content}->[0]->%*], default => [sort keys $plugindata->{content}->[1]->%*], }, origin => plugin_origin($plugin), schema => get_schema_for_plugin($plugin), type => $type, }; + + my $display_name = $plugindata->{meta}->{'display-name'}; + if (defined($display_name) && !ref($display_name) && length($display_name)) { + $metadata->{'display-name'} = $display_name; + } + + return $metadata; } # plugins/storage/plugin __PACKAGE__->register_method({ -- 2.47.3