all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Max Carrara <m.carrara@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [RFC v1 pve-storage 4/6] plugin: replace fixme comments for deprecated methods with attribute
Date: Thu, 30 Jan 2025 15:51:22 +0100	[thread overview]
Message-ID: <20250130145124.317745-5-m.carrara@proxmox.com> (raw)
In-Reply-To: <20250130145124.317745-1-m.carrara@proxmox.com>

This makes it so that the `get_volume_notes` and `update_volume_notes`
methods use the previously introduced `prohibitOverrideAt` attribute
handler instead of relying on FIXME comments.

Because the comments originally said to "remove on the next APIAGE
reset", the `version` for the two attributes is set to 10 (the current
APIVER). This means that compilation will fail as soon as APIAGE is
reset to 0 (or APIVER is bumped without bumping APIAGE).

This can be tested by running `make test` inside the `src/` directory
of the repository. Without changing the APIAGE, warnings will be
emitted. Setting the APIAGE to 0 and then running `make test` again
will throw an exception before running any other code.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
---
 src/PVE/Storage/CIFSPlugin.pm   |  4 ----
 src/PVE/Storage/CephFSPlugin.pm |  4 ----
 src/PVE/Storage/DirPlugin.pm    |  5 +----
 src/PVE/Storage/NFSPlugin.pm    |  4 ----
 src/PVE/Storage/PBSPlugin.pm    |  4 ----
 src/PVE/Storage/Plugin.pm       | 14 ++++++++------
 6 files changed, 9 insertions(+), 26 deletions(-)

diff --git a/src/PVE/Storage/CIFSPlugin.pm b/src/PVE/Storage/CIFSPlugin.pm
index 475065a..89a9981 100644
--- a/src/PVE/Storage/CIFSPlugin.pm
+++ b/src/PVE/Storage/CIFSPlugin.pm
@@ -292,15 +292,11 @@ sub check_connection {
     return 1;
 }
 
-# FIXME remove on the next APIAGE reset.
-# Deprecated, use get_volume_attribute instead.
 sub get_volume_notes {
     my $class = shift;
     PVE::Storage::DirPlugin::get_volume_notes($class, @_);
 }
 
-# FIXME remove on the next APIAGE reset.
-# Deprecated, use update_volume_attribute instead.
 sub update_volume_notes {
     my $class = shift;
     PVE::Storage::DirPlugin::update_volume_notes($class, @_);
diff --git a/src/PVE/Storage/CephFSPlugin.pm b/src/PVE/Storage/CephFSPlugin.pm
index 36c64ea..934ba8b 100644
--- a/src/PVE/Storage/CephFSPlugin.pm
+++ b/src/PVE/Storage/CephFSPlugin.pm
@@ -239,15 +239,11 @@ sub deactivate_storage {
     }
 }
 
-# FIXME remove on the next APIAGE reset.
-# Deprecated, use get_volume_attribute instead.
 sub get_volume_notes {
     my $class = shift;
     PVE::Storage::DirPlugin::get_volume_notes($class, @_);
 }
 
-# FIXME remove on the next APIAGE reset.
-# Deprecated, use update_volume_attribute instead.
 sub update_volume_notes {
     my $class = shift;
     PVE::Storage::DirPlugin::update_volume_notes($class, @_);
diff --git a/src/PVE/Storage/DirPlugin.pm b/src/PVE/Storage/DirPlugin.pm
index fb23e0a..79c7a94 100644
--- a/src/PVE/Storage/DirPlugin.pm
+++ b/src/PVE/Storage/DirPlugin.pm
@@ -9,6 +9,7 @@ use File::Path;
 use IO::File;
 use POSIX;
 
+use PVE::Storage::Version;
 use PVE::Storage::Plugin;
 use PVE::GuestImport::OVF;
 use PVE::JSONSchema qw(get_standard_option);
@@ -127,8 +128,6 @@ my $get_volume_notes_impl = sub {
     return '';
 };
 
-# FIXME remove on the next APIAGE reset.
-# Deprecated, use get_volume_attribute instead.
 sub get_volume_notes {
     my ($class, $scfg, $storeid, $volname, $timeout) = @_;
     return $get_volume_notes_impl->($class, $scfg, $storeid, $volname, $timeout);
@@ -153,8 +152,6 @@ my $update_volume_notes_impl = sub {
     return;
 };
 
-# FIXME remove on the next APIAGE reset.
-# Deprecated, use update_volume_attribute instead.
 sub update_volume_notes {
     my ($class, $scfg, $storeid, $volname, $notes, $timeout) = @_;
     return $update_volume_notes_impl->($class, $scfg, $storeid, $volname, $notes, $timeout);
diff --git a/src/PVE/Storage/NFSPlugin.pm b/src/PVE/Storage/NFSPlugin.pm
index 72e9c6d..0dfdc95 100644
--- a/src/PVE/Storage/NFSPlugin.pm
+++ b/src/PVE/Storage/NFSPlugin.pm
@@ -201,15 +201,11 @@ sub check_connection {
     return 1;
 }
 
-# FIXME remove on the next APIAGE reset.
-# Deprecated, use get_volume_attribute instead.
 sub get_volume_notes {
     my $class = shift;
     PVE::Storage::DirPlugin::get_volume_notes($class, @_);
 }
 
-# FIXME remove on the next APIAGE reset.
-# Deprecated, use update_volume_attribute instead.
 sub update_volume_notes {
     my $class = shift;
     PVE::Storage::DirPlugin::update_volume_notes($class, @_);
diff --git a/src/PVE/Storage/PBSPlugin.pm b/src/PVE/Storage/PBSPlugin.pm
index 0808bcc..f0f1b06 100644
--- a/src/PVE/Storage/PBSPlugin.pm
+++ b/src/PVE/Storage/PBSPlugin.pm
@@ -850,8 +850,6 @@ sub deactivate_volume {
     return 1;
 }
 
-# FIXME remove on the next APIAGE reset.
-# Deprecated, use get_volume_attribute instead.
 sub get_volume_notes {
     my ($class, $scfg, $storeid, $volname, $timeout) = @_;
 
@@ -862,8 +860,6 @@ sub get_volume_notes {
     return $data->{notes};
 }
 
-# FIXME remove on the next APIAGE reset.
-# Deprecated, use update_volume_attribute instead.
 sub update_volume_notes {
     my ($class, $scfg, $storeid, $volname, $notes, $timeout) = @_;
 
diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm
index bcc4eea..0c80859 100644
--- a/src/PVE/Storage/Plugin.pm
+++ b/src/PVE/Storage/Plugin.pm
@@ -1217,17 +1217,19 @@ sub file_size_info {
     return wantarray ? ($size, $format, $used, $parent, $st->ctime) : $size;
 }
 
-# FIXME remove on the next APIAGE reset.
-# Deprecated, use get_volume_attribute instead.
-sub get_volume_notes {
+sub get_volume_notes : prohibitOverrideAt(
+    version => 10,
+    message => "Deprecated, use get_volume_attribute instead."
+) {
     my ($class, $scfg, $storeid, $volname, $timeout) = @_;
 
     die "volume notes are not supported for $class";
 }
 
-# FIXME remove on the next APIAGE reset.
-# Deprecated, use update_volume_attribute instead.
-sub update_volume_notes {
+sub update_volume_notes : prohibitOverrideAt(
+    version => 10,
+    message => "Deprecated, use update_volume_attribute instead.",
+) {
     my ($class, $scfg, $storeid, $volname, $notes, $timeout) = @_;
 
     die "volume notes are not supported for $class";
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2025-01-30 14:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-30 14:51 [pve-devel] [RFC v1 pve-storage 0/6] RFC: Tighter API Control for Storage Plugins Max Carrara
2025-01-30 14:51 ` [pve-devel] [RFC v1 pve-storage 1/6] version: introduce PVE::Storage::Version Max Carrara
2025-02-05 11:20   ` Wolfgang Bumiller
2025-01-30 14:51 ` [pve-devel] [RFC v1 pve-storage 2/6] rework plugin loading and registration mechanism Max Carrara
2025-02-05 11:33   ` Wolfgang Bumiller
2025-01-30 14:51 ` [pve-devel] [RFC v1 pve-storage 3/6] introduce compile-time checks for prohibited sub overrides Max Carrara
2025-02-05 11:41   ` Wolfgang Bumiller
2025-02-05 11:55     ` Wolfgang Bumiller
2025-01-30 14:51 ` Max Carrara [this message]
2025-01-30 14:51 ` [pve-devel] [RFC v1 pve-storage 5/6] introduce check for `type` method and duplicate types Max Carrara
2025-01-30 14:51 ` [pve-devel] [RFC v1 pve-storage 6/6] introduce check for duplicate plugin properties Max Carrara
2025-02-05 11:17 ` [pve-devel] [RFC v1 pve-storage 0/6] RFC: Tighter API Control for Storage Plugins Wolfgang Bumiller
2025-02-05 15:20   ` Max Carrara
2025-02-06 14:05     ` Fiona Ebner
2025-02-06 14:39       ` Thomas Lamprecht
2025-02-06 14:56         ` Fiona Ebner
2025-02-07  7:17           ` Thomas Lamprecht
2025-02-07  9:59             ` Fiona Ebner
2025-02-07 11:57               ` Thomas Lamprecht
2025-02-07 15:25                 ` Fiona Ebner

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=20250130145124.317745-5-m.carrara@proxmox.com \
    --to=m.carrara@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