[pve-devel] [PATCH] rbd -p parameter is only valid for the src (see man). Add the pool to the target as well.

Stefan Priebe s.priebe at profihost.ag
Sun Apr 21 20:04:57 CEST 2013


Signed-off-by: Stefan Priebe <s.priebe at profihost.ag>
---
 PVE/Storage/RBDPlugin.pm |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index e625999..4662585 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -17,6 +17,14 @@ sub rbd_unittobytes {
   }
 }
 
+my $add_pool_to_disk = sub {
+    my ($scfg, $disk) = @_;
+
+    my $pool =  $scfg->{pool} ? $scfg->{pool} : 'rbd';
+
+    return "$pool/$disk";
+};
+
 my $rbd_cmd = sub {
     my ($scfg, $storeid, $op, @options) = @_;
 
@@ -283,7 +291,7 @@ sub create_base {
 
     my $newvolname = $basename ? "$basename/$newname" : "$newname";
 
-    my $cmd = &$rbd_cmd($scfg, $storeid, 'rename', $name, $newname);
+    my $cmd = &$rbd_cmd($scfg, $storeid, 'rename', &$add_pool_to_disk($scfg, $name), &$add_pool_to_disk($scfg, $newname));
     run_command($cmd, errmsg => "rbd rename $name' error", errfunc => sub {});
 
     my $running  = undef; #fixme : is create_base always offline ?
-- 
1.7.10.4



More information about the pve-devel mailing list