mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-07 06:37:28 +00:00
introduce one global CLOUDINIT_DISK_SIZE constant
The variable is used instead of the literal value so we have one single place to change the actual value of every use. Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
This commit is contained in:
parent
a357092190
commit
7d761a016d
@ -159,8 +159,8 @@ my $create_disks = sub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Initial disk created with 4 MB and aligned to 4MB on regeneration
|
# Initial disk created with 4 MB and aligned to 4MB on regeneration
|
||||||
my $ci_size = 4 * 1024;
|
my $ci_size = PVE::QemuServer::Cloudinit::CLOUDINIT_DISK_SIZE;
|
||||||
my $volid = PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, $fmt, $name, $ci_size);
|
my $volid = PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, $fmt, $name, $ci_size/1024);
|
||||||
$disk->{file} = $volid;
|
$disk->{file} = $volid;
|
||||||
$disk->{media} = 'cdrom';
|
$disk->{media} = 'cdrom';
|
||||||
push @$vollist, $volid;
|
push @$vollist, $volid;
|
||||||
|
@ -11,6 +11,8 @@ use PVE::Tools qw(run_command file_set_contents);
|
|||||||
use PVE::Storage;
|
use PVE::Storage;
|
||||||
use PVE::QemuServer;
|
use PVE::QemuServer;
|
||||||
|
|
||||||
|
use constant CLOUDINIT_DISK_SIZE => 4 * 1024 * 1024; # 4MiB in bytes
|
||||||
|
|
||||||
sub commit_cloudinit_disk {
|
sub commit_cloudinit_disk {
|
||||||
my ($conf, $vmid, $drive, $volname, $storeid, $files, $label) = @_;
|
my ($conf, $vmid, $drive, $volname, $storeid, $files, $label) = @_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user