From: Fiona Ebner <f.ebner@proxmox.com>
To: Christian Ludwig <christian_ludwig@genua.de>,
pve-devel@lists.proxmox.com
Subject: Re: [PATCH qemu-server v3 09/19] config: define bios schema as property-string
Date: Thu, 5 Nov 2026 16:23:55 +0100 [thread overview]
Message-ID: <cbe02471-ea08-413a-b3e3-e78466a20dd2@proxmox.com> (raw)
In-Reply-To: <85e63753ada8c733e10dd43b7600a749592f3ccd.1793029144.git@genua.de>
The qemu-server patches need a rebase. More comments below:
Am 27.10.26 um 11:14 AM schrieb Christian Ludwig:
> Convert the bios parameter to a property-string and use the BIOS type as
> the default key for backward compatibility. This allows adding further
> BIOS related options, like a custom firmware image, as sub-properties.
>
> Add helpers to parse and print the property-string and to query the
> BIOS type, and use the latter everywhere the bios option was compared
> directly. No functional change intended.
>
> Signed-off-by: Christian Ludwig <christian_ludwig@genua.de>
> ---
> src/PVE/QemuConfig.pm | 3 ++-
> src/PVE/QemuServer.pm | 15 ++++++-----
> src/PVE/QemuServer/BIOS.pm | 48 +++++++++++++++++++++++++++++++++
> src/PVE/QemuServer/CPUConfig.pm | 5 ++--
> src/PVE/QemuServer/Makefile | 1 +
> src/PVE/QemuServer/PCI.pm | 3 ++-
> 6 files changed, 64 insertions(+), 11 deletions(-)
> create mode 100644 src/PVE/QemuServer/BIOS.pm
>
> diff --git a/src/PVE/QemuConfig.pm b/src/PVE/QemuConfig.pm
> index 2ef6c075..d83a474c 100644
> --- a/src/PVE/QemuConfig.pm
> +++ b/src/PVE/QemuConfig.pm
> @@ -10,6 +10,7 @@ use PVE::INotify;
> use PVE::JSONSchema;
> use PVE::QemuMigrate::Helpers;
> use PVE::QemuServer::Agent;
> +use PVE::QemuServer::BIOS;
> use PVE::QemuServer::Blockdev;
> use PVE::QemuServer::CPUConfig;
> use PVE::QemuServer::Drive;
> @@ -192,7 +193,7 @@ sub get_backup_volumes {
> my $reason = "backup=";
> $reason .= defined($drive->{backup}) ? 'no' : 'yes';
>
> - if ($key =~ m/^efidisk/ && (!defined($conf->{bios}) || $conf->{bios} ne 'ovmf')) {
> + if ($key =~ m/^efidisk/ && PVE::QemuServer::BIOS::get_bios_type($conf) ne 'ovmf') {
Minor style nit: could import the function like in other places for
easier readability in the conditional
> $included = 0;
> $reason = "efidisk but no OVMF BIOS";
> }
> diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
> index 74772fdd..c288ba22 100644
> --- a/src/PVE/QemuServer.pm
> +++ b/src/PVE/QemuServer.pm
> @@ -53,6 +53,7 @@ use PVE::QemuConfig;
> use PVE::QemuConfig::NoWrite;
> use PVE::QemuMigrate::Helpers;
> use PVE::QemuServer::Agent qw(get_qga_key parse_guest_agent qga_check_running);
> +use PVE::QemuServer::BIOS qw(get_bios_type);
> use PVE::QemuServer::Blockdev;
> use PVE::QemuServer::BlockJob;
> use PVE::QemuServer::Cfg2Cmd;
> @@ -659,7 +660,7 @@ EODESCR
> bios => {
> optional => 1,
> type => 'string',
> - enum => [qw(seabios ovmf)],
> + format => 'pve-qm-bios',
> description => "Select BIOS implementation.",
> default => 'seabios',
The default should be moved to the new 'type' property inside.
> },
> @@ -1535,7 +1536,7 @@ sub print_vga_device {
>
> my $edidoff = "";
> if ($type eq 'VGA' && windows_version($conf->{ostype})) {
> - $edidoff = ",edid=off" if (!defined($conf->{bios}) || $conf->{bios} ne 'ovmf');
> + $edidoff = ",edid=off" if get_bios_type($conf) ne 'ovmf';
> }
>
> my $q35 = PVE::QemuServer::Machine::machine_type_is_q35($conf);
> @@ -3075,7 +3076,7 @@ my sub should_disable_smm {
> return if $machine =~ m/^virt/; # there is no smm flag that could be disabled
>
> return
> - (!defined($conf->{bios}) || $conf->{bios} eq 'seabios')
> + get_bios_type($conf) eq 'seabios'
> && $vga->{type}
> && $vga->{type} =~ m/^(serial\d+|none)$/;
> }
> @@ -3258,7 +3259,7 @@ sub config_to_command {
> push @$cmd, '-smbios', "type=1" . $smbios_string;
> }
>
> - if ($conf->{bios} && $conf->{bios} eq 'ovmf') {
> + if (get_bios_type($conf) eq 'ovmf') {
> die "OVMF (UEFI) BIOS is not supported on 32-bit CPU types\n"
> if !$forcecpu && get_cpu_bitness($conf->{cpu}, $arch) == 32;
>
> @@ -3771,10 +3772,10 @@ sub config_to_command {
> }
>
> if ($conf->{'amd-sev'}) {
> - push @$devices, '-object', get_amd_sev_object($conf->{'amd-sev'}, $conf->{bios});
> + push @$devices, '-object', get_amd_sev_object($conf->{'amd-sev'}, get_bios_type($conf));
> push @$machineFlags, 'confidential-guest-support=sev0';
> } elsif ($conf->{'intel-tdx'}) {
> - my $tdx_object = get_intel_tdx_object($conf->{'intel-tdx'}, $conf->{bios});
> + my $tdx_object = get_intel_tdx_object($conf->{'intel-tdx'}, get_bios_type($conf));
> push @$devices, '-object', to_json($tdx_object, { canonical => 1 });
> push @$machineFlags, 'confidential-guest-support=tdx0';
> push @$machineFlags, 'kernel_irqchip=split';
> @@ -5631,7 +5632,7 @@ sub vm_start_nolock {
> my $storage_hints = generate_storage_hints($conf, 1);
> PVE::Storage::activate_volumes($storecfg, $vollist, undef, $storage_hints);
>
> - check_efi_vars($storecfg, $vmid, $conf) if $conf->{bios} && $conf->{bios} eq 'ovmf';
> + check_efi_vars($storecfg, $vmid, $conf) if get_bios_type($conf) eq 'ovmf';
>
> PVE::QemuServer::Drive::warn_about_virtio_win_issues_in_config($conf);
>
> diff --git a/src/PVE/QemuServer/BIOS.pm b/src/PVE/QemuServer/BIOS.pm
> new file mode 100644
> index 00000000..4e1a3936
> --- /dev/null
> +++ b/src/PVE/QemuServer/BIOS.pm
> @@ -0,0 +1,48 @@
> +package PVE::QemuServer::BIOS;
> +
> +use strict;
> +use warnings;
Nit: please use v5.36; and subroutine signatures for new modules.
> +
> +use PVE::JSONSchema qw(parse_property_string print_property_string);
> +
> +use base 'Exporter';
> +
next prev parent reply other threads:[~2026-11-05 15:24 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 10:12 [PATCH v3 00/19] Support for custom EFI firmware Christian Ludwig
2026-10-27 10:12 ` [PATCH pve-storage v3 01/19] plugin: add efi-firmware content type Christian Ludwig
2026-11-03 16:31 ` Fiona Ebner
2026-10-27 10:12 ` [PATCH pve-storage v3 02/19] test: get_subdir: cover the " Christian Ludwig
2026-10-27 10:12 ` [PATCH pve-storage v3 03/19] plugins: allow the efi-firmware content type on file based storages Christian Ludwig
2026-10-27 10:12 ` [PATCH pve-storage v3 04/19] plugin: support efi-firmware volumes in volume export and import Christian Ludwig
2026-10-27 10:12 ` [PATCH pve-storage v3 05/19] api: status: support efi-firmware in upload and download-url Christian Ludwig
2026-11-03 16:31 ` Fiona Ebner
2026-10-27 10:12 ` [PATCH pve-storage v3 06/19] test: volume access: cover efi-firmware volumes Christian Ludwig
2026-10-27 10:12 ` [PATCH pve-storage v3 07/19] test: list volumes: " Christian Ludwig
2026-10-27 10:12 ` [PATCH pve-storage v3 08/19] test: cover efi-firmware volumes in parse_volname and path_to_volume_id Christian Ludwig
2026-10-27 10:12 ` [PATCH qemu-server v3 09/19] config: define bios schema as property-string Christian Ludwig
2026-11-05 15:23 ` Fiona Ebner [this message]
2026-10-27 10:12 ` [PATCH qemu-server v3 10/19] bios: add a custom firmware sub-property Christian Ludwig
2026-11-05 15:23 ` Fiona Ebner
2026-10-27 10:12 ` [PATCH qemu-server v3 11/19] api: check the custom firmware of the bios option Christian Ludwig
2026-11-05 15:23 ` Fiona Ebner
2026-10-27 10:12 ` [PATCH qemu-server v3 12/19] test: custom firmware in " Christian Ludwig
2026-10-27 10:12 ` [PATCH qemu-server v3 13/19] test: custom firmware volumes in replication and migration Christian Ludwig
2026-10-27 10:12 ` [PATCH pve-manager v3 14/19] ui: storage: add efi-firmware content type support Christian Ludwig
2026-10-27 10:12 ` [PATCH pve-manager v3 15/19] ui: form: support other content types in the ISO selector Christian Ludwig
2026-10-27 10:12 ` [PATCH pve-manager v3 16/19] ui: qemu: allow selecting a custom EFI firmware image Christian Ludwig
2026-10-27 10:12 ` [PATCH pve-manager v3 17/19] ui: migrate: refuse migration with a local custom " Christian Ludwig
2026-10-27 10:12 ` [PATCH pve-docs v3 18/19] pvesm: document the efi-firmware content type Christian Ludwig
2026-10-27 10:12 ` [PATCH pve-docs v3 19/19] qm: document the custom firmware of the bios option Christian Ludwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cbe02471-ea08-413a-b3e3-e78466a20dd2@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=christian_ludwig@genua.de \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox