]> git.proxmox.com Git - qemu-server.git/commitdiff
followup: do not query size of image we just created
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 30 Apr 2019 13:09:21 +0000 (13:09 +0000)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 30 Apr 2019 13:09:23 +0000 (13:09 +0000)
we know the size, and even if a storage plugin pads this up (it
mustn't alloc something smaller, but something bigger can be OK) we
know that our 4MB is OK, and can only be used anyway to make this
compatible between storage plugins.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/QemuServer/Cloudinit.pm

index 981e6afd2fd563e7ddfd17cac2407cde19cafd7b..6b99b462894975c99c7296a6d8ad6136393160f3 100644 (file)
@@ -36,8 +36,9 @@ sub commit_cloudinit_disk {
     if ($size <= 0) {
        $volname =~ m/(vm-$vmid-cloudinit(.(qcow2|raw))?)/;
        my $name = $1;
-       my $d = PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, $format, $name, 4 * 1024);
-       $size = PVE::Storage::file_size_info($iso_path);
+       $size = 4 * 1024;
+       PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, $format, $name, $size);
+       $size *= 1024; # vdisk alloc takes KB, qemu-img dd's osize takes byte
     }
 
     my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});