]> git.proxmox.com Git - pve-container.git/commitdiff
copy_volume: get the real volume size
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 7 May 2018 12:52:47 +0000 (14:52 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 7 May 2018 13:39:50 +0000 (15:39 +0200)
Since we're not supposed to rely on this property being
there or even correct.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/PVE/LXC.pm

index 423ce21dd07c27d3852603622c1a3f0017a4026a..de3c91fb1953265b1049681e208b878cde0ddb8b 100644 (file)
@@ -1679,6 +1679,8 @@ sub copy_volume {
     # (not-mounted) directory.
     my $new_volid;
     eval {
+       # Make sure $mp contains a correct size.
+       $mp->{size} = PVE::Storage::volume_size_info($storage_cfg, $mp->{volume});
        my $needs_chown;
        ($new_volid, $needs_chown) = alloc_disk($storage_cfg, $vmid, $storage, $mp->{size}/1024, $rootuid, $rootgid);
        if ($needs_chown) {