From b6d98e13f5841c923686575ed68c91b985b3a125 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 3 Apr 2025 20:49:44 +0200 Subject: [PATCH] vm start: log task warning if both SEV-SNP and efidisk are configured Make it more noticeable if a efidisk will be ignored, as this means one changed a existing VM that already had a efidisk entry to SEV-SNP, as adding an efidisk for such VMs with SEV-SNP enabled is blocked. While at it fix indentation and drop the duplicated $arch variable, that's already declared as required here at the top of the method. Signed-off-by: Thomas Lamprecht --- PVE/QemuServer.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 17a7bd25..96786a96 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -3561,10 +3561,10 @@ sub config_to_command { my $amd_sev_type = get_amd_sev_type($conf); if ($amd_sev_type && $amd_sev_type eq 'snp') { - my $arch = PVE::QemuServer::Helpers::get_vm_arch($conf); - print "Existing EFI disk will be ignored for SEV-SNP\n" - if parse_drive('efidisk0', $conf->{efidisk0}); - push $cmd->@*, '-bios', get_ovmf_files($arch, undef, undef, $amd_sev_type); + if (defined($conf->{efidisk0})) { + log_warn("EFI disks are not supported with SEV-SNP and will be ignored"); + } + push $cmd->@*, '-bios', get_ovmf_files($arch, undef, undef, $amd_sev_type); } else { my ($code_drive_str, $var_drive_str) = print_ovmf_drive_commandlines( $conf, $storecfg, $vmid, $arch, $q35, $version_guard);