public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Christian Ludwig <christian_ludwig@genua.de>,
	pve-devel@lists.proxmox.com
Subject: Re: [PATCH v2 qemu-server 08/16] api: allow setting the efi-firmware option
Date: Mon, 5 Oct 2026 16:36:48 +0200	[thread overview]
Message-ID: <44be5b02-5510-4458-ab5a-dd6a81f0c939@proxmox.com> (raw)
In-Reply-To: <112600c5d24f1a06ab9049b1b234035c989d0135.1790337726.git@genua.de>

Am 28.09.26 um 7:49 AM schrieb Christian Ludwig:
> Add the option to the POST/PUT {vmid}/config endpoints. It needs
> VM.Config.Options permission, like the 'bios' option it modifies, and is
> rejected without bios=ovmf.
> 
> Deleting it does not trigger volume cleanup, firmware images are shared.
> 
> Signed-off-by: Christian Ludwig <christian_ludwig@genua.de>
> ---
>  src/PVE/API2/Qemu.pm | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
> index 71247eec..8b12bb53 100644
> --- a/src/PVE/API2/Qemu.pm
> +++ b/src/PVE/API2/Qemu.pm
> @@ -277,6 +277,10 @@ my $check_storage_access = sub {
>          "/storage/$settings->{vmstatestorage}",
>          ['Datastore.AllocateSpace'],
>      ) if defined($settings->{vmstatestorage});
> +
> +    PVE::Storage::check_volume_access(
> +        $rpcenv, $authuser, $storecfg, $vmid, $settings->{'efi-firmware'}, 'efi-firmware',
> +    ) if defined($settings->{'efi-firmware'});
>  };
>  
>  my $check_storage_access_clone = sub {
> @@ -825,6 +829,7 @@ my $generaloptions = {

I wonder if it's not more fitting in the $hwtypeoptions? But not sure.
My suggestion to have it be a sub-property of 'bios' would conflict with
that again.

>      'autostart' => 1,
>      'bios' => 1,
>      'description' => 1,
> +    'efi-firmware' => 1,
>      'keyboard' => 1,
>      'localtime' => 1,
>      'migrate_downtime' => 1,
> @@ -1366,6 +1371,9 @@ __PACKAGE__->register_method({
>  
>              $check_drive_param->($param, $storecfg);
>  
> +            raise_param_exc({ 'efi-firmware' => "requires bios=ovmf" })
> +                if $param->{'efi-firmware'} && ($param->{bios} // '') ne 'ovmf';
> +
>              PVE::QemuServer::Network::add_random_macs($param);
>          }
>  
> @@ -2527,6 +2535,13 @@ my $update_vm_api = sub {
>                      print "automatic pinning of machine version failed - $@" if $@;
>                  }
>                  $conf->{pending}->{$opt} = $param->{$opt};
> +            } elsif ($opt eq 'efi-firmware') {
> +                PVE::Storage::check_volume_access(
> +                    $rpcenv, $authuser, $storecfg, $vmid, $param->{$opt}, 'efi-firmware',
> +                );
> +                my $bios = $param->{bios} // $conf->{pending}->{bios} // $conf->{bios} // '';
> +                raise_param_exc({ $opt => "requires bios=ovmf" }) if $bios ne 'ovmf';
> +                $conf->{pending}->{$opt} = $param->{$opt};

This covers the case where 'efi-firmware' changes, but it could be that
the 'bios' setting is changed away from 'ovmf' later on, so you'd also
need to check in a branch for 'bios', there also for deletion. Might be
good to have a helper and call that from all relevant places. Or if
having 'bios' be a property string, it can be checked together.

>              } elsif ($opt eq 'cipassword') {
>                  if (!PVE::QemuServer::Helpers::windows_version($conf->{ostype})) {
>                      # Same logic as in cloud-init (but with the regex fixed...)

Best Regards,
Fiona





  reply	other threads:[~2026-10-05 14:36 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28  5:47 [PATCH v2 0/16] Support for custom EFI firmware Christian Ludwig
2026-09-28  5:47 ` [PATCH v2 pve-storage 1/16] plugin: add efi-firmware content type Christian Ludwig
2026-10-05 14:37   ` Fiona Ebner
2026-09-28  5:47 ` [PATCH v2 pve-storage 2/16] test: get_subdir: cover the " Christian Ludwig
2026-10-05 14:36   ` Fiona Ebner
2026-09-28  5:48 ` [PATCH v2 pve-storage 3/16] plugins: allow the efi-firmware content type on file based storages Christian Ludwig
2026-10-05 14:36   ` Fiona Ebner
2026-09-28  5:48 ` [PATCH v2 pve-storage 4/16] api: status: support efi-firmware in upload and download-url Christian Ludwig
2026-10-05 14:37   ` Fiona Ebner
2026-09-28  5:48 ` [PATCH v2 pve-storage 5/16] test: volume access: cover efi-firmware volumes Christian Ludwig
2026-10-05 14:36   ` Fiona Ebner
2026-09-28  5:48 ` [PATCH v2 pve-storage 6/16] test: list volumes: " Christian Ludwig
2026-10-05 14:37   ` Fiona Ebner
2026-09-28  5:48 ` [PATCH v2 qemu-server 07/16] config: add the efi-firmware option Christian Ludwig
2026-10-05 14:37   ` Fiona Ebner
2026-09-28  5:48 ` [PATCH v2 qemu-server 08/16] api: allow setting " Christian Ludwig
2026-10-05 14:36   ` Fiona Ebner [this message]
2026-09-28  5:48 ` [PATCH v2 qemu-server 09/16] ovmf: use a custom firmware image if configured Christian Ludwig
2026-10-05 14:36   ` Fiona Ebner
2026-09-28  5:48 ` [PATCH v2 qemu-server 10/16] test: efi-firmware key in VM config Christian Ludwig
2026-09-28  5:48 ` [PATCH v2 qemu-server 11/16] test: efi-firmware volumes replication Christian Ludwig
2026-09-28  5:48 ` [PATCH v2 pve-manager 12/16] ui: storage: add efi-firmware content type support Christian Ludwig
2026-09-28  5:48 ` [PATCH v2 pve-manager 13/16] ui: form: support other content types in the ISO selector Christian Ludwig
2026-09-28  5:48 ` [PATCH v2 pve-manager 14/16] ui: qemu: allow selecting a custom EFI firmware image Christian Ludwig
2026-09-28  5:48 ` [PATCH v2 pve-docs 15/16] pvesm: document the efi-firmware content type Christian Ludwig
2026-09-28  5:48 ` [PATCH v2 pve-docs 16/16] qm: document the efi-firmware VM option Christian Ludwig
2026-10-05 14:36 ` [PATCH v2 0/16] Support for custom EFI firmware Fiona Ebner
2026-10-08  8:37   ` 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=44be5b02-5510-4458-ab5a-dd6a81f0c939@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal