5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-25 06:03:52 +03:00

followup: do not query size of image we just created

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>
This commit is contained in:
Thomas Lamprecht 2019-04-30 13:09:21 +00:00
parent 6aaf593cfd
commit 84821d1515

View 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});