From b265925d641512b1e71e46296f8601e963555b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 22 Apr 2025 10:56:16 +0200 Subject: [PATCH] rbd: merge rbd_cmd and build_cmd helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit since the former was just a wrapper around the latter, and the only call site.. Signed-off-by: Fabian Grünbichler Reviewed-By: Aaron Lauterer Tested-By: Aaron Lauterer --- src/PVE/Storage/RBDPlugin.pm | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/PVE/Storage/RBDPlugin.pm b/src/PVE/Storage/RBDPlugin.pm index 162c016..73bc97e 100644 --- a/src/PVE/Storage/RBDPlugin.pm +++ b/src/PVE/Storage/RBDPlugin.pm @@ -84,14 +84,13 @@ my sub get_rbd_dev_path { return $pve_path; } -my $build_cmd = sub { - my ($binary, $scfg, $storeid, $op, @options) = @_; +my $rbd_cmd = sub { + my ($scfg, $storeid, $op, @options) = @_; my $cmd_option = PVE::CephConfig::ceph_connect_option($scfg, $storeid); my $pool = $scfg->{pool} ? $scfg->{pool} : 'rbd'; - - my $cmd = [$binary]; + my $cmd = ['/usr/bin/rbd']; if ($op eq 'import') { push $cmd->@*, '--dest-pool', $pool; } else { @@ -118,12 +117,6 @@ my $build_cmd = sub { return $cmd; }; -my $rbd_cmd = sub { - my ($scfg, $storeid, $op, @options) = @_; - - return $build_cmd->('/usr/bin/rbd', $scfg, $storeid, $op, @options); -}; - # needed for volumes created using ceph jewel (or higher) my $krbd_feature_update = sub { my ($scfg, $storeid, $name) = @_;