]> git.proxmox.com Git - pve-storage.git/commitdiff
rbd: followup code style cleanups
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 4 Feb 2022 17:04:31 +0000 (18:04 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 4 Feb 2022 17:04:31 +0000 (18:04 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/Storage/RBDPlugin.pm

index efb218777f3be88a600d49387f68715905210866..e287e286c9a3e1a275f84a5e6bd7ac1bd8988de3 100644 (file)
@@ -497,11 +497,13 @@ sub clone_image {
     my $newvol = "$basename/$name";
     $newvol = $name if length($snapname);
 
-    my @options = ('clone', get_rbd_path($scfg, $basename), '--snap', $snap);
+    my @options = (
+       get_rbd_path($scfg, $basename),
+       '--snap', $snap,
+    );
     push @options, ('--data-pool', $scfg->{'data-pool'}) if $scfg->{'data-pool'};
-    push @options, get_rbd_path($scfg, $name);
-    my $cmd = $rbd_cmd->($scfg, $storeid, @options);
 
+    my $cmd = $rbd_cmd->($scfg, $storeid, 'clone', @options, get_rbd_path($scfg, $name));
     run_rbd_command($cmd, errmsg => "rbd clone '$basename' error");
 
     return $newvol;
@@ -516,10 +518,13 @@ sub alloc_image {
 
     $name = $class->find_free_diskname($storeid, $scfg, $vmid) if !$name;
 
-    my @options = ('create', '--image-format' , 2, '--size', int(($size+1023)/1024));
+    my @options = (
+       '--image-format' , 2,
+       '--size', int(($size + 1023) / 1024),
+    );
     push @options, ('--data-pool', $scfg->{'data-pool'}) if $scfg->{'data-pool'};
-    push @options, $name;
-    my $cmd = $rbd_cmd->($scfg, $storeid, @options);
+
+    my $cmd = $rbd_cmd->($scfg, $storeid, 'create', @options, $name);
     run_rbd_command($cmd, errmsg => "rbd create '$name' error");
 
     return $name;