From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id BBDE11FF137 for ; Tue, 03 Feb 2026 11:22:47 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 81EC919DFD; Tue, 3 Feb 2026 11:22:25 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH manager v2 11/17] ui: qemu: make bios selector architecture aware Date: Tue, 3 Feb 2026 11:00:16 +0100 Message-ID: <20260203102118.1430545-12-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260203102118.1430545-1-d.csapak@proxmox.com> References: <20260203102118.1430545-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.032 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: YWR5HOJ5HXLY7MHJEVAEO26OF3HVX6IF X-Message-ID-Hash: YWR5HOJ5HXLY7MHJEVAEO26OF3HVX6IF X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: since not all firmware variants are available/supported on every architecture, limit the selector to variants that make sense (e.g. to 'ovmf' on aarch64). Same mechanism like the scsi hw selector. Signed-off-by: Dominik Csapak --- www/manager6/form/QemuBiosSelector.js | 18 ++++++++--------- www/manager6/qemu/QemuBiosEdit.js | 29 +++++++++++++++++++++++++-- www/manager6/qemu/SystemEdit.js | 3 +++ 3 files changed, 38 insertions(+), 12 deletions(-) diff --git a/www/manager6/form/QemuBiosSelector.js b/www/manager6/form/QemuBiosSelector.js index 5fa443f1..40abb589 100644 --- a/www/manager6/form/QemuBiosSelector.js +++ b/www/manager6/form/QemuBiosSelector.js @@ -1,16 +1,14 @@ Ext.define('PVE.form.QemuBiosSelector', { - extend: 'Proxmox.form.KVComboBox', + extend: 'PVE.form.FilteredKVComboBox', alias: ['widget.pveQemuBiosSelector'], - initComponent: function () { - var me = this; + comboItems: [ + ['__default__', PVE.Utils.render_qemu_bios('')], + ['seabios', PVE.Utils.render_qemu_bios('seabios')], + ['ovmf', PVE.Utils.render_qemu_bios('ovmf')], + ], - me.comboItems = [ - ['__default__', PVE.Utils.render_qemu_bios('')], - ['seabios', PVE.Utils.render_qemu_bios('seabios')], - ['ovmf', PVE.Utils.render_qemu_bios('ovmf')], - ]; + allowedValuesPerCategory: PVE.qemu.Architecture.allowedFirmware, - me.callParent(); - }, + setDefaultDisplay: (arch) => PVE.Utils.render_qemu_bios('', arch), }); diff --git a/www/manager6/qemu/QemuBiosEdit.js b/www/manager6/qemu/QemuBiosEdit.js index ef8f1844..76e5cfb1 100644 --- a/www/manager6/qemu/QemuBiosEdit.js +++ b/www/manager6/qemu/QemuBiosEdit.js @@ -4,7 +4,6 @@ Ext.define('PVE.qemu.BiosEdit', { onlineHelp: 'qm_bios_and_uefi', subject: 'BIOS', - autoLoad: true, viewModel: { data: { @@ -22,7 +21,10 @@ Ext.define('PVE.qemu.BiosEdit', { onlineHelp: 'qm_bios_and_uefi', name: 'bios', value: '__default__', - bind: '{bios}', + bind: { + value: '{bios}', + category: '{arch}', + }, fieldLabel: 'BIOS', }, { @@ -42,4 +44,27 @@ Ext.define('PVE.qemu.BiosEdit', { }, }, ], + + initComponent: function () { + let me = this; + + me.nodename = me.pveSelNode?.data.node; + + if (!me.nodename) { + throw 'no nodename given'; + } + + me.callParent(); + + if (!me.isCreate) { + me.load({ + success: function ({ result }) { + let values = result.data; + let arch = PVE.qemu.Architecture.getNodeArchitecture(values.arch, me.nodename); + me.setValues(values); + me.down('pveQemuBiosSelector').setCategory(arch); + }, + }); + } + }, }); diff --git a/www/manager6/qemu/SystemEdit.js b/www/manager6/qemu/SystemEdit.js index 8bc92bd9..0c1e03ca 100644 --- a/www/manager6/qemu/SystemEdit.js +++ b/www/manager6/qemu/SystemEdit.js @@ -102,6 +102,9 @@ Ext.define('PVE.qemu.SystemInputPanel', { reference: 'bios', value: '__default__', fieldLabel: 'BIOS', + bind: { + category: '{current.architecture}', + }, }, { xtype: 'proxmoxcheckbox', -- 2.47.3