mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-29 20:58:54 +00:00
clone disk: pass in efi vars size rather than config
It's confusing that the config associated to the destination is actually a reference to the source config for both existing callers. Also, disk import will need to base the calculation on the passed-in drive parameters and not just the current config, so this change is in preparation for that too. Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
1196086ff1
commit
7344af7bf8
@ -3227,11 +3227,13 @@ __PACKAGE__->register_method({
|
||||
|
||||
my $dest_info = {
|
||||
vmid => $newid,
|
||||
conf => $oldconf, # because it's a clone
|
||||
storage => $storage,
|
||||
format => $format,
|
||||
};
|
||||
|
||||
$dest_info->{efisize} = PVE::QemuServer::get_efivars_size($oldconf)
|
||||
if $opt eq 'efidisk0';
|
||||
|
||||
my $newdrive = PVE::QemuServer::clone_disk(
|
||||
$storecfg,
|
||||
$source_info,
|
||||
@ -3486,11 +3488,13 @@ __PACKAGE__->register_method({
|
||||
|
||||
my $dest_info = {
|
||||
vmid => $vmid,
|
||||
conf => $conf,
|
||||
storage => $storeid,
|
||||
format => $format,
|
||||
};
|
||||
|
||||
$dest_info->{efisize} = PVE::QemuServer::get_efivars_size($conf)
|
||||
if $disk eq 'efidisk0';
|
||||
|
||||
my $newdrive = PVE::QemuServer::clone_disk(
|
||||
$storecfg,
|
||||
$source_info,
|
||||
|
@ -7576,7 +7576,7 @@ sub clone_disk {
|
||||
my ($vmid, $running) = $source->@{qw(vmid running)};
|
||||
my ($drivename, $drive, $snapname) = $source->@{qw(drivename drive snapname)};
|
||||
|
||||
my ($newvmid, $conf) = $dest->@{qw(vmid conf)};
|
||||
my ($newvmid, $efisize) = $dest->@{qw(vmid efisize)};
|
||||
my ($storage, $format) = $dest->@{qw(storage format)};
|
||||
|
||||
my $newvolid;
|
||||
@ -7604,7 +7604,7 @@ sub clone_disk {
|
||||
$snapname = undef;
|
||||
$size = PVE::QemuServer::Cloudinit::CLOUDINIT_DISK_SIZE;
|
||||
} elsif ($drivename eq 'efidisk0') {
|
||||
$size = get_efivars_size($conf);
|
||||
$size = $efisize or die "internal error - need to specify EFI disk size\n";
|
||||
} elsif ($drivename eq 'tpmstate0') {
|
||||
$dst_format = 'raw';
|
||||
$size = PVE::QemuServer::Drive::TPMSTATE_DISK_SIZE;
|
||||
|
Loading…
Reference in New Issue
Block a user