From 4db25fa2a69827710a7d63351d881abbee692947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Fri, 3 Feb 2017 13:00:15 +0100 Subject: [PATCH] rbd: use consistent image name schemes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit since we allow vm-ID-whatever when allocating images, we should also include those when listing them. note: '@' is reserved for snapshots in ceph, so it is safe to skip lines including an '@' in the image name. Signed-off-by: Fabian Grünbichler --- PVE/Storage/RBDPlugin.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm index b44b9ba..3875656 100644 --- a/PVE/Storage/RBDPlugin.pm +++ b/PVE/Storage/RBDPlugin.pm @@ -184,8 +184,9 @@ sub rbd_ls { my $parser = sub { my $line = shift; - if ($line =~ m/^((vm|base)-(\d+)-disk-\d+)\s+(\d+)(k|M|G|T)\s((\S+)\/((vm|base)-\d+-\S+@\S+))?/) { + if ($line =~ m/^((vm|base)-(\d+)-\S+)\s+(\d+)(k|M|G|T)\s((\S+)\/((vm|base)-\d+-\S+@\S+))?/) { my ($image, $owner, $size, $unit, $parent) = ($1, $3, $4, $5, $8); + next if $image =~ m/"@"/; #skip snapshots $list->{$pool}->{$image} = { name => $image,