From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 16AC91FF187 for ; Mon, 8 Sep 2025 20:01:55 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 84AEE18ACF; Mon, 8 Sep 2025 20:01:37 +0200 (CEST) From: "Max R. Carrara" To: pve-devel@lists.proxmox.com Date: Mon, 8 Sep 2025 20:00:47 +0200 Message-ID: <20250908180058.530119-4-m.carrara@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250908180058.530119-1-m.carrara@proxmox.com> References: <20250908180058.530119-1-m.carrara@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1757354442244 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.087 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [RFC pve-storage master v1 03/12] plugin: meta: introduce 'short-name' X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" 'short-name' is a new key that can be defined in a plugin's `plugindata()`, containing the plugin's "colloquially used" or abbreviated name. For example: - ZFS pool plugin / 'zfspool' --> "ZFS" - Directory plugin / 'dir' --> "Directory" - LVM thin pool plugin / 'lvmthin' --> "LVM-Thin" - ... and so on. This key is added so that custom storage plugins can define how they are named in user interfaces and whatnot, instead of just using their `type()`. Optionally return 'short-name' as part of the 'plugins/storage' and 'plugins/storage/{plugin}' endpoints. Signed-off-by: Max R. Carrara --- src/PVE/API2/Plugins/Storage/Config.pm | 4 ++++ src/PVE/Storage/Plugin/Meta.pm | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/PVE/API2/Plugins/Storage/Config.pm b/src/PVE/API2/Plugins/Storage/Config.pm index 064aec9..2160e4e 100644 --- a/src/PVE/API2/Plugins/Storage/Config.pm +++ b/src/PVE/API2/Plugins/Storage/Config.pm @@ -33,6 +33,10 @@ my $PLUGIN_METADATA_SCHEMA = { enum => plugin_kinds(), optional => 0, }, + 'short-name' => { + type => 'string', + optional => 1, + }, content => { type => 'object', optional => 0, diff --git a/src/PVE/Storage/Plugin/Meta.pm b/src/PVE/Storage/Plugin/Meta.pm index 6d0cb51..561c01b 100644 --- a/src/PVE/Storage/Plugin/Meta.pm +++ b/src/PVE/Storage/Plugin/Meta.pm @@ -134,6 +134,9 @@ my sub assemble_plugin_metadata() { kind => $kind, }; + $metadata->{'short-name'} = $plugin->plugindata()->{'short-name'} + if defined($plugin->plugindata()->{'short-name'}); + $metadata->{content} = assemble_plugin_metadata_content($plugin); $metadata->{format} = assemble_plugin_metadata_format($plugin); -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel