rbd : parse_volname : parse base

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier
2013-02-05 12:55:29 +01:00
committed by Dietmar Maurer
parent ff00afd7fb
commit d04c7e55a8

View File

@ -172,8 +172,8 @@ sub options {
sub parse_volname {
my ($class, $volname) = @_;
if ($volname =~ m/^(vm-(\d+)-\S+)$/) {
return ('images', $1, $2);
if ($volname =~ m/^((base-(\d+)-\S+)\/)?((base)?(vm)?-(\d+)-\S+)$/) {
return ('images', $4, $7, $2, $3, $5);
}
die "unable to parse rbd volume name '$volname'\n";