From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 5E1061FF13B for ; Wed, 28 Jan 2026 13:31:14 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 546FE10FF5; Wed, 28 Jan 2026 13:31:10 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Wed, 28 Jan 2026 13:18:11 +0100 Message-ID: <20260128123035.2576774-11-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260128123035.2576774-1-d.csapak@proxmox.com> References: <20260128123035.2576774-1-d.csapak@proxmox.com> MIME-Version: 1.0 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 Subject: [pve-devel] [PATCH manager 10/10] ui: qemu: wizard: use defaults to populate machine and bios X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" instead of hardcoding some values here for win11, use the OSDefaults mechanism to load it for all. This makes it also architecture aware. rename the function to 'setDefaults' as it's a more fitting name now. Signed-off-by: Dominik Csapak --- www/manager6/qemu/OSDefaults.js | 7 +++++++ www/manager6/qemu/SystemEdit.js | 16 ++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/www/manager6/qemu/OSDefaults.js b/www/manager6/qemu/OSDefaults.js index 3a707d60..b679f58d 100644 --- a/www/manager6/qemu/OSDefaults.js +++ b/www/manager6/qemu/OSDefaults.js @@ -109,6 +109,13 @@ Ext.define('PVE.qemu.OSDefaults', { parent: 'w2k', }); + addOS({ + pveOS: 'win11', + parent: 'generic', + machine: 'q35', + bios: 'ovmf', + }); + me.getDefaults = function (ostype, arch = 'x86_64') { if (!PVE.qemu.OSDefaults[ostype]) { ostype = 'generic'; diff --git a/www/manager6/qemu/SystemEdit.js b/www/manager6/qemu/SystemEdit.js index 4b72b274..7422d3e7 100644 --- a/www/manager6/qemu/SystemEdit.js +++ b/www/manager6/qemu/SystemEdit.js @@ -57,19 +57,27 @@ Ext.define('PVE.qemu.SystemInputPanel', { change: 'biosChange', }, '#': { - afterrender: 'setMachine', + afterrender: 'setDefaults', }, }, - setMachine: function () { + setDefaults: function () { let me = this; let vm = this.getViewModel(); + let ostype = vm.get('current.ostype'); + let architecture = PVE.Utils.getArchitecture( + vm.get('current.architecture'), + vm.get('nodename'), + ); + + let defaults = PVE.qemu.OSDefaults.getDefaults(ostype, architecture); if (ostype === 'win11') { - me.lookup('machine').setValue('q35'); - me.lookup('bios').setValue('ovmf'); me.lookup('addtpmbox').setValue(true); } + + me.lookup('machine').setValue(defaults.machine ?? '__default__'); + me.lookup('bios').setValue(defaults.bios ?? '__default__'); }, }, -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel