[pve-devel] [PATCH manager v3 02/10] ceph: setpool, use parameter extraction instead

Alwin Antreich a.antreich at proxmox.com
Tue Jan 12 11:21:45 CET 2021


of the unneeded ref copy for params.

Signed-off-by: Alwin Antreich <a.antreich at proxmox.com>
---
 PVE/API2/Ceph/Pools.pm | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/PVE/API2/Ceph/Pools.pm b/PVE/API2/Ceph/Pools.pm
index fac21301..b9e295f5 100644
--- a/PVE/API2/Ceph/Pools.pm
+++ b/PVE/API2/Ceph/Pools.pm
@@ -377,15 +377,11 @@ __PACKAGE__->register_method ({
 	my $rpcenv = PVE::RPCEnvironment::get();
 	my $authuser = $rpcenv->get_user();
 
-	my $pool = $param->{name};
-	my $ceph_param = \%$param;
-	for my $item ('name', 'node') {
-	    # not ceph parameters
-	    delete $ceph_param->{$item};
-	}
+	my $pool = extract_param($param, 'name');
+	my $node = extract_param($param, 'node');
 
 	my $worker = sub {
-	    PVE::Ceph::Tools::set_pool($pool, $ceph_param);
+	    PVE::Ceph::Tools::set_pool($pool, $param);
 	};
 
 	return $rpcenv->fork_worker('cephsetpool', $pool,  $authuser, $worker);
-- 
2.29.2





More information about the pve-devel mailing list