public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Joaquin Varela <joaquinvarela@neatech.ar>
To: pve-devel@lists.proxmox.com
Cc: Joaquin Varela <joaquinvarela@neatech.ar>
Subject: [PATCH storage v2 6/7] zfsnvme: accept short volume activation calls
Date: Sun,  2 Aug 2026 00:31:40 -0300	[thread overview]
Message-ID: <158683ac8934029e61e466577d325eab9e36812e.1785636979.git.joaquinvarela@neatech.ar> (raw)
In-Reply-To: <cover.1785636979.git.joaquinvarela@neatech.ar>

Default optional snapshot and cache arguments so internal callers such as
cloud-init can use the short activation and deactivation form. Cover both
calls in the storage plugin test.

Signed-off-by: Joaquin Varela <joaquinvarela@neatech.ar>
---
 src/PVE/Storage/ZFSNVMePlugin.pm | 11 +++++++++--
 src/test/zfsnvme_test.pm         | 25 +++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/src/PVE/Storage/ZFSNVMePlugin.pm b/src/PVE/Storage/ZFSNVMePlugin.pm
index 21fa00d..54c406d 100644
--- a/src/PVE/Storage/ZFSNVMePlugin.pm
+++ b/src/PVE/Storage/ZFSNVMePlugin.pm
@@ -777,7 +777,7 @@ sub activate_volume(
     $storeid,
     $scfg,
     $volname,
-    $snapname,
+    $snapname = undef,
     $cache = undef,
     $hints = undef,
 ) {
@@ -795,7 +795,14 @@ sub activate_volume(
     return 1;
 }
 
-sub deactivate_volume($class, $storeid, $scfg, $volname, $snapname, $cache = undef) {
+sub deactivate_volume(
+    $class,
+    $storeid,
+    $scfg,
+    $volname,
+    $snapname = undef,
+    $cache = undef,
+) {
     die "unable to deactivate snapshot from remote zfs storage\n" if $snapname;
     return 1;
 }
diff --git a/src/test/zfsnvme_test.pm b/src/test/zfsnvme_test.pm
index 128ebf1..d64b149 100644
--- a/src/test/zfsnvme_test.pm
+++ b/src/test/zfsnvme_test.pm
@@ -219,6 +219,31 @@ like(
     'activate_volume accepts the current storage API hints argument',
 );
 
+$nvme_mock->redefine(activate_storage => sub { die "activation attempted\n" });
+eval {
+    PVE::Storage::ZFSNVMePlugin->activate_volume(
+        'nvmetest',
+        $scfg,
+        'vm-100-disk-0',
+    );
+};
+like(
+    $@,
+    qr/activation attempted/,
+    'activate_volume accepts the short direct-call form used by cloud-init',
+);
+$nvme_mock->unmock('activate_storage');
+
+is(
+    PVE::Storage::ZFSNVMePlugin->deactivate_volume(
+        'nvmetest',
+        $scfg,
+        'vm-100-disk-0',
+    ),
+    1,
+    'deactivate_volume accepts the short direct-call form',
+);
+
 my $lio_mock = Test::MockModule->new('PVE::Storage::LunCmd::LIO');
 my @provider_args;
 $lio_mock->redefine(
-- 
2.54.0.windows.1




  parent reply	other threads:[~2026-08-02  3:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-02  3:31 [PATCH storage v2 0/7] add native ZFS over NVMe/TCP backend Joaquin Varela
2026-08-02  3:31 ` [PATCH storage v2 1/7] zfs: make LUN provider dispatch overridable Joaquin Varela
2026-08-02  3:31 ` [PATCH storage v2 2/7] zfs: add native NVMe/TCP storage backend Joaquin Varela
2026-08-02  3:31 ` [PATCH storage v2 3/7] zfsnvme: harden node preflight and storage teardown Joaquin Varela
2026-08-02  3:31 ` [PATCH storage v2 4/7] zfsnvme: make all-path loss policy explicit Joaquin Varela
2026-08-02  3:31 ` [PATCH storage v2 5/7] zfsnvme: accept activation hints from storage API Joaquin Varela
2026-08-02  3:31 ` Joaquin Varela [this message]
2026-08-02  3:31 ` [PATCH storage v2 7/7] zfsnvme: restore ACLs before publishing target Joaquin Varela

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=158683ac8934029e61e466577d325eab9e36812e.1785636979.git.joaquinvarela@neatech.ar \
    --to=joaquinvarela@neatech.ar \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal