[pve-devel] [PATCH 29/31] rbd: sub path: add snapname argument

Alexandre Derumier aderumier at odiso.com
Tue Jan 8 15:45:35 CET 2013


needed for qemu-img convert from src snapshot

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Storage/RBDPlugin.pm |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index 10f1f8b..a09b731 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -187,7 +187,7 @@ sub parse_volname {
 }
 
 sub path {
-    my ($class, $scfg, $volname, $storeid) = @_;
+    my ($class, $scfg, $volname, $storeid, $snapname) = @_;
 
     my ($vtype, $name, $vmid) = $class->parse_volname($volname);
 
@@ -195,7 +195,8 @@ sub path {
     my $pool = $scfg->{pool};
     my $username = $scfg->{username};
     my $authsupported = addslashes($scfg->{authsupported});
-    
+    $name .= '@'.$snapname if $snapname;
+
     my $path = "rbd:$pool/$name:id=$username:auth_supported=$authsupported:keyring=/etc/pve/priv/ceph/$storeid.keyring:mon_host=$monhost";
 
     return ($path, $vmid, $vtype);
-- 
1.7.10.4




More information about the pve-devel mailing list