[pve-devel] [PATCH 33/48] rbd: sub path: add snapname argument

Alexandre Derumier aderumier at odiso.com
Tue Jan 29 17:14:15 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 b9688e9..f331bbc 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -193,7 +193,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);
 
@@ -201,7 +201,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