5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-10 01:18:01 +03:00

migrate: add size to volume attributes

Signed-off-by: Tim Marx <t.marx@proxmox.com>
This commit is contained in:
Tim Marx 2019-06-28 15:13:47 +02:00 committed by Thomas Lamprecht
parent f25852c27e
commit c272ba8db3

View File

@ -3334,7 +3334,7 @@ sub foreach_volid {
my $volhash = {}; my $volhash = {};
my $test_volid = sub { my $test_volid = sub {
my ($volid, $is_cdrom, $replicate, $shared, $snapname) = @_; my ($volid, $is_cdrom, $replicate, $shared, $snapname, $size) = @_;
return if !$volid; return if !$volid;
@ -3352,11 +3352,12 @@ sub foreach_volid {
$volhash->{$volid}->{referenced_in_snapshot}->{$snapname} = 1 $volhash->{$volid}->{referenced_in_snapshot}->{$snapname} = 1
if defined($snapname); if defined($snapname);
$volhash->{$volid}->{size} = $size if $size;
}; };
foreach_drive($conf, sub { foreach_drive($conf, sub {
my ($ds, $drive) = @_; my ($ds, $drive) = @_;
$test_volid->($drive->{file}, drive_is_cdrom($drive), $drive->{replicate} // 1, $drive->{shared}, undef); $test_volid->($drive->{file}, drive_is_cdrom($drive), $drive->{replicate} // 1, $drive->{shared}, undef, $drive->{size});
}); });
foreach my $snapname (keys %{$conf->{snapshots}}) { foreach my $snapname (keys %{$conf->{snapshots}}) {