]> git.proxmox.com Git - qemu-server.git/commitdiff
efivars size: allow overriding efidisk parameter
authorFabian Ebner <f.ebner@proxmox.com>
Wed, 9 Mar 2022 10:09:10 +0000 (11:09 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 11 Mar 2022 09:45:59 +0000 (10:45 +0100)
For disk import, it should be based on the disk properties that are
passed in rather than on those of a possibly pre-existing disk in the
config.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/QemuServer.pm

index b98ed3dc2c6aa3603068049804a981e5a0a37d71..b246602e6fa4632e362df98cb1868cee9b458ce9 100644 (file)
@@ -7703,9 +7703,10 @@ sub qemu_use_old_bios_files {
 }
 
 sub get_efivars_size {
-    my ($conf) = @_;
+    my ($conf, $efidisk) = @_;
+
     my $arch = get_vm_arch($conf);
-    my $efidisk = $conf->{efidisk0} ? parse_drive('efidisk0', $conf->{efidisk0}) : undef;
+    $efidisk //= $conf->{efidisk0} ? parse_drive('efidisk0', $conf->{efidisk0}) : undef;
     my $smm = PVE::QemuServer::Machine::machine_type_is_q35($conf);
     my (undef, $ovmf_vars) = get_ovmf_files($arch, $efidisk, $smm);
     die "uefi vars image '$ovmf_vars' not found\n" if ! -f $ovmf_vars;