rbd: use consistent image name schemes
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 <f.gruenbichler@proxmox.com>
This commit is contained in:
committed by
Wolfgang Bumiller
parent
53a236f2c5
commit
4db25fa2a6
@ -184,8 +184,9 @@ sub rbd_ls {
|
|||||||
my $parser = sub {
|
my $parser = sub {
|
||||||
my $line = shift;
|
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);
|
my ($image, $owner, $size, $unit, $parent) = ($1, $3, $4, $5, $8);
|
||||||
|
next if $image =~ m/"@"/; #skip snapshots
|
||||||
|
|
||||||
$list->{$pool}->{$image} = {
|
$list->{$pool}->{$image} = {
|
||||||
name => $image,
|
name => $image,
|
||||||
|
|||||||
Reference in New Issue
Block a user