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 E7CED1FF137 for ; Tue, 03 Feb 2026 11:22:09 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 82541196B4; Tue, 3 Feb 2026 11:22:01 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH manager v2 08/17] ui: qemu: make osdefaults architecture aware Date: Tue, 3 Feb 2026 11:00:13 +0100 Message-ID: <20260203102118.1430545-9-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: BKR37BCJSOJSQK3G3B5DRFKHYYLBMFXO X-Message-ID-Hash: BKR37BCJSOJSQK3G3B5DRFKHYYLBMFXO 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: This enables us to have different default for different architectures, e.g. using 'ovmf' for 'aarch64' for everything. The external interface should be compatible, so there is nothing to do for current callers. Signed-off-by: Dominik Csapak --- www/manager6/qemu/OSDefaults.js | 76 ++++++++++++++++++++++++++------- 1 file changed, 60 insertions(+), 16 deletions(-) diff --git a/www/manager6/qemu/OSDefaults.js b/www/manager6/qemu/OSDefaults.js index bcebd0b3..d921ab53 100644 --- a/www/manager6/qemu/OSDefaults.js +++ b/www/manager6/qemu/OSDefaults.js @@ -24,8 +24,17 @@ Ext.define('PVE.qemu.OSDefaults', { let addOS = function (settings) { if (Object.hasOwn(settings, 'parent')) { - let child = Ext.clone(me[settings.parent]); - me[settings.pveOS] = Ext.apply(child, settings); + let architectures = settings.architectures; + delete settings.architectures; + + let child = { + x86_64: Ext.apply({}, settings, me[settings.parent].x86_64), + }; + + for (const arch of Object.keys(architectures ?? {})) { + child[arch] = Ext.apply({}, architectures[arch], me[settings.parent][arch]); + } + me[settings.pveOS] = child; } else { throw 'Could not find your genitor'; } @@ -33,16 +42,33 @@ Ext.define('PVE.qemu.OSDefaults', { // default values me.generic = { - busType: 'ide', - networkCard: 'e1000', - busPriority: { - ide: 4, - sata: 3, - scsi: 2, - virtio: 1, + x86_64: { + busType: 'ide', + networkCard: 'e1000', + busPriority: { + ide: 4, + sata: 3, + scsi: 2, + virtio: 1, + }, + scsihw: 'virtio-scsi-single', + cputype: 'x86-64-v2-AES', + }, + + aarch64: { + // aarch64 has no ide, and ovmf can't boot from sata + busType: 'scsi', + networkCard: 'e1000', + busPriority: { + scsi: 4, + sata: 3, + virtio: 2, + ide: 1, + }, + scsihw: 'virtio-scsi-single', + cputype: 'neoverse-n2', + bios: 'ovmf', }, - scsihw: 'virtio-scsi-single', - cputype: 'x86-64-v2-AES', }; // virtio-net is in kernel since 2.6.25 @@ -58,6 +84,18 @@ Ext.define('PVE.qemu.OSDefaults', { ide: 1, }, networkCard: 'virtio', + + architectures: { + aarch64: { + busPriority: { + scsi: 4, + virtio: 2, + sata: 2, + ide: 1, + }, + networkCard: 'virtio', + }, + }, }); // recommendation from http://wiki.qemu.org/Windows2000 @@ -73,12 +111,18 @@ Ext.define('PVE.qemu.OSDefaults', { parent: 'w2k', }); - me.getDefaults = function (ostype) { - if (PVE.qemu.OSDefaults[ostype]) { - return PVE.qemu.OSDefaults[ostype]; - } else { - return PVE.qemu.OSDefaults.generic; + me.getDefaults = function (ostype, arch = 'x86_64') { + if (!PVE.qemu.OSDefaults[ostype]) { + ostype = 'generic'; } + + let os = PVE.qemu.OSDefaults[ostype]; + if (os[arch]) { + return os[arch]; + } + + // default + return os.x86_64; }; }, }); -- 2.47.3