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 41B9D1FF13B for ; Wed, 28 Jan 2026 13:30:37 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 633DD10E1E; Wed, 28 Jan 2026 13:30:41 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Wed, 28 Jan 2026 13:18:06 +0100 Message-ID: <20260128123035.2576774-6-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 05/10] ui: qemu: make osdefaults architecture aware 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" 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 | 74 ++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 16 deletions(-) diff --git a/www/manager6/qemu/OSDefaults.js b/www/manager6/qemu/OSDefaults.js index bcebd0b3..3a707d60 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,32 @@ 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: 3, + sata: 2, + virtio: 1, + }, + scsihw: 'virtio-scsi-single', + cputype: 'x86-64-v2-AES', + bios: 'ovmf', }, - scsihw: 'virtio-scsi-single', - cputype: 'x86-64-v2-AES', }; // virtio-net is in kernel since 2.6.25 @@ -58,6 +83,17 @@ Ext.define('PVE.qemu.OSDefaults', { ide: 1, }, networkCard: 'virtio', + + architectures: { + aarch64: { + busPriority: { + scsi: 3, + virtio: 2, + sata: 1, + }, + networkCard: 'virtio', + }, + }, }); // recommendation from http://wiki.qemu.org/Windows2000 @@ -73,12 +109,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 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel