From c272ba8db316303d2033d5d6eaa761f7438f9755 Mon Sep 17 00:00:00 2001 From: Tim Marx Date: Fri, 28 Jun 2019 15:13:47 +0200 Subject: [PATCH] migrate: add size to volume attributes Signed-off-by: Tim Marx --- PVE/QemuServer.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 1f3234ff..35e26331 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -3334,7 +3334,7 @@ sub foreach_volid { my $volhash = {}; my $test_volid = sub { - my ($volid, $is_cdrom, $replicate, $shared, $snapname) = @_; + my ($volid, $is_cdrom, $replicate, $shared, $snapname, $size) = @_; return if !$volid; @@ -3352,11 +3352,12 @@ sub foreach_volid { $volhash->{$volid}->{referenced_in_snapshot}->{$snapname} = 1 if defined($snapname); + $volhash->{$volid}->{size} = $size if $size; }; foreach_drive($conf, sub { 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}}) {