[pve-devel] [PATCH 04/44] rbd : list_images
Alexandre Derumier
aderumier at odiso.com
Tue Feb 5 12:55:31 CET 2013
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/Storage/RBDPlugin.pm | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index 301f64d..1c01f0e 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -257,8 +257,15 @@ sub list_images {
foreach my $image (keys %$dat) {
my $volname = $dat->{$image}->{name};
-
- my $volid = "$storeid:$volname";
+ my $parent = $dat->{$image}->{parent};
+
+ my $volid = undef;
+ if ($parent && $parent =~ m/^(\S+)@(\S+)$/) {
+ my ($basename) = ($1);
+ $volid = "$storeid:$basename/$volname";
+ } else {
+ $volid = "$storeid:$volname";
+ }
my $owner = $dat->{$volname}->{vmid};
if ($vollist) {
--
1.7.10.4
More information about the pve-devel
mailing list