[pve-devel] [PATCH 09/10] rbd: path : add snapname

Alexandre Derumier aderumier at odiso.com
Thu Feb 14 17:27:39 CET 2013


needed for qemu-img convert from a 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 a460826..95b759f 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -194,7 +194,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);
 
@@ -202,7 +202,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