5
0
mirror of git://git.proxmox.com/git/pve-storage.git synced 2024-12-22 13:34:16 +03:00

sheepdog : fix volume_size_info && parentid check

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2012-12-12 13:02:33 +01:00 committed by Dietmar Maurer
parent ba4ee9ba25
commit 73b6f89b3c

View File

@ -65,7 +65,7 @@ sub sheepdog_ls {
my $size = $4;
my $idvdi = $9;
my $parentid = $relationship->{$idvdi}->{parent} if $relationship->{$idvdi}->{parent};
my $parent = $relationship->{$parentid}->{name};
my $parent = $relationship->{$parentid}->{name} if $parentid;
$list->{$storeid}->{$image} = {
name => $image,
size => $size,
@ -272,13 +272,13 @@ sub volume_size_info {
my $size = undef;
my $cmd = &$collie_cmd($scfg, 'vdi', 'list', '-r', $volname);
my $cmd = &$collie_cmd($scfg, 'vdi', 'list', '-r');
run_command($cmd, outfunc => sub {
my $line = shift;
$line = trim($line);
if ($line =~ /= (vm-(\d+)-\S+)\s+(\d+)\s+(\d+)\s(\d+)\s(\d+)\s/) {
$size = $4;
if ($line =~ /(=|c) $volname\s+(\d+)\s+(\d+)\s(\d+)\s(\d+)\s/) {
$size = $3;
}
});