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 DACDF1FF15C for ; Fri, 31 Oct 2025 11:37:02 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C7C89EA83; Fri, 31 Oct 2025 11:37:23 +0100 (CET) From: Friedrich Weber To: pve-devel@lists.proxmox.com Date: Fri, 31 Oct 2025 11:36:09 +0100 Message-ID: <20251031103709.60233-3-f.weber@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251031103709.60233-1-f.weber@proxmox.com> References: <20251031103709.60233-1-f.weber@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761907024363 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.011 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 KAM_SHORT 0.001 Use of a URL Shortener for very short URL RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [storage.pm, gnu.org] Subject: [pve-devel] [PATCH storage 2/5] plugin api: bump api version and age 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" Introduce $hints parameter to activate_volume() and map_volume(). Signed-off-by: Friedrich Weber --- ApiChangeLog | 42 ++++++++++++++++++++++++++++++++++++++++++ src/PVE/Storage.pm | 4 ++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/ApiChangeLog b/ApiChangeLog index d80bfb3..508f85e 100644 --- a/ApiChangeLog +++ b/ApiChangeLog @@ -6,6 +6,48 @@ without breaking anything unaware of it.) Future changes should be documented in here. +## Version 13: + +* Add new parameter $hints to the `activate_volume()` and `map_volume()` plugin methods + + Old signature of `activate_volume()`: + + sub($plugin, $storeid, $scfg, $volname, $snapname, $cache) + + New signature of `activate_volume()`: + + sub($plugin, $storeid, $scfg, $volname, $snapname, $cache, $hints) + + Old signature of `map_volume()`: + + sub($plugin, $storeid, $scfg, $volname, $snapname) + + New signature of `map_volume()`: + + sub($plugin, $storeid, $scfg, $volname, $snapname, $hints) + + Hints are a mechanism that allows the upper layers to optionally pass down well-defined + information to the storage plugins on volume activation/mapping. The storage plugin can make + adjustments to its volume activation/mapping based on the hints (we call this "applying" the + hint). + + If the new parameter $hints is defined, it is a hash reference that adheres to the schema + `PVE::Storage::Plugin::$hints_format` (verified by caller). The supported hints are specified in + `PVE::Storage::Plugin::$hints_properties` and may be extended in the future. It is not guaranteed + that the volume is inactive when `activate_volume()` or `map_volume()` are called, and it is not + guaranteed that hints are passed on every storage activation. Hints may be passed at additional + storage activation call sites in the future without an API version bump. + + It can happen a volume is already active but applying the hint would require unmapping the volume + and mapping it again with the hint applied. To cover such cases, the Boolean hint + 'plugin-may-deactivate-volume' denotes whether unmapping the volume is currently safe. Only if + this hint is true, the plugin may deactivate the volume and map it again with the hint applied. + + Hints may be added in the future without an API version bump. Plugins may call + `PVE::Storage::Plugin::is_hint_supported()` to check whether a specific hint is supported. + + Plugins that do not require hints can safely ignore the additional parameter. + ## Version 12: * Introduce `qemu_blockdev_options()` plugin method diff --git a/src/PVE/Storage.pm b/src/PVE/Storage.pm index 1dde2b7..ca0bf0e 100755 --- a/src/PVE/Storage.pm +++ b/src/PVE/Storage.pm @@ -41,11 +41,11 @@ use PVE::Storage::BTRFSPlugin; use PVE::Storage::ESXiPlugin; # Storage API version. Increment it on changes in storage API interface. -use constant APIVER => 12; +use constant APIVER => 13; # Age is the number of versions we're backward compatible with. # This is like having 'current=APIVER' and age='APIAGE' in libtool, # see https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html -use constant APIAGE => 3; +use constant APIAGE => 4; our $KNOWN_EXPORT_FORMATS = ['raw+size', 'tar+size', 'qcow2+size', 'vmdk+size', 'zfs', 'btrfs']; -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel