use PVE::QMPClient;
use PVE::RPCEnvironment;
use Time::HiRes qw(gettimeofday);
+use File::Copy qw(copy);
my $qemu_snap_storage = {rbd => 1, sheepdog => 1};
description => "Sets the protection flag of the VM. This will prevent the remove operation.",
default => 0,
},
+ ovmf => {
+ optional => 1,
+ type => 'boolean',
+ description => "Enable ovmf uefi roms.",
+ default => 0,
+ },
};
# what about other qemu settings ?
push @$cmd, '-smbios', "type=1,$conf->{smbios1}";
}
+ if ($conf->{ovmf}) {
+ my $ovmfvar = "OVMF_VARS-pure-efi.fd";
+ my $ovmfvar_src = "/usr/share/kvm/$ovmfvar";
+ my $ovmfvar_dst = "/tmp/$vmid-$ovmfvar";
+ copy $ovmfvar_src,$ovmfvar_dst if !(-e $ovmfvar_dst);
+ push @$cmd, '-drive', "if=pflash,format=raw,readonly,file=/usr/share/kvm/OVMF-pure-efi.fd";
+ push @$cmd, '-drive', "if=pflash,format=raw,file=$ovmfvar_dst";
+ }
+
if ($q35) {
# the q35 chipset support native usb2, so we enable usb controller
# by default for this machine type