From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 9BCB394DF0 for ; Thu, 11 Apr 2024 12:49:43 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7FF6A1FC28 for ; Thu, 11 Apr 2024 12:49:13 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 11 Apr 2024 12:49:12 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 2222944B71 for ; Thu, 11 Apr 2024 12:49:12 +0200 (CEST) From: Markus Frank To: pve-devel@lists.proxmox.com Date: Thu, 11 Apr 2024 12:48:22 +0200 Message-Id: <20240411104822.832432-4-m.frank@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240411104822.832432-1-m.frank@proxmox.com> References: <20240411104822.832432-1-m.frank@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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [data.id] Subject: [pve-devel] [PATCH manager v9 3/3] ui: machine: add viommu ComboBox 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: , X-List-Received-Date: Thu, 11 Apr 2024 10:49:43 -0000 Added a proxmoxKVComboBox for selecting a vIOMMU implementation for a VM. If i440fx is selected, a hint tells that q35 is required for Intel vIOMMU. The UI also needs to parse the new machine parameter as PropertyString. Signed-off-by: Markus Frank --- www/manager6/qemu/MachineEdit.js | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/www/manager6/qemu/MachineEdit.js b/www/manager6/qemu/MachineEdit.js index f928c80c..45f3d34d 100644 --- a/www/manager6/qemu/MachineEdit.js +++ b/www/manager6/qemu/MachineEdit.js @@ -1,6 +1,7 @@ Ext.define('PVE.qemu.MachineInputPanel', { extend: 'Proxmox.panel.InputPanel', xtype: 'pveMachineInputPanel', + onlineHelp: 'qm_system_settings', controller: { xclass: 'Ext.app.ViewController', @@ -12,11 +13,14 @@ Ext.define('PVE.qemu.MachineInputPanel', { onMachineChange: function(field, value) { let me = this; let version = me.lookup('version'); + let q35Hint = me.lookup('q35Hint'); let store = version.getStore(); let oldRec = store.findRecord('id', version.getValue(), 0, false, false, true); let type = value === 'q35' ? 'q35' : 'i440fx'; store.clearFilter(); store.addFilter(val => val.data.id === 'latest' || val.data.type === type); + // show hint when Intel vIOMMU cannot be used + q35Hint.setVisible(type === 'i440fx'); if (!me.getView().isWindows) { version.setValue('latest'); } else { @@ -40,12 +44,30 @@ Ext.define('PVE.qemu.MachineInputPanel', { delete values.delete; } delete values.version; + if (values.machine === undefined) { + if (values.viommu) { + delete values.delete; + values.machine = "pc"; + } else { + values.delete = "machine"; + } + } + if (values.viommu) { + values.machine += ",viommu=" + values.viommu; + } + if (values.delete === "viommu") { + delete values.delete; + } + delete values.viommu; return values; }, setValues: function(values) { let me = this; + let machineConf = PVE.Parser.parsePropertyString(values.machine, "type"); + values.machine = machineConf.type; + me.isWindows = values.isWindows; if (values.machine === 'pc') { values.machine = '__default__'; @@ -58,6 +80,9 @@ Ext.define('PVE.qemu.MachineInputPanel', { values.version = 'pc-q35-5.1'; } } + + values.viommu = machineConf.viommu || "__default__"; + if (values.machine !== '__default__' && values.machine !== 'q35') { values.version = values.machine; values.machine = values.version.match(/q35/) ? 'q35' : '__default__'; @@ -113,6 +138,26 @@ Ext.define('PVE.qemu.MachineInputPanel', { fieldLabel: gettext('Note'), value: gettext('Machine version change may affect hardware layout and settings in the guest OS.'), }, + { + xtype: 'proxmoxKVComboBox', + fieldLabel: gettext('vIOMMU'), + name: 'viommu', + reference: 'viommu', + value: '__default__', + comboItems: [ + ['__default__', Proxmox.Utils.defaultText + ' (None)'], + ['intel', 'Intel'], + ['virtio', 'VirtIO'], + ], + }, + { + xtype: 'displayfield', + name: 'q35Hint', + reference: 'q35Hint', + userCls: 'pmx-hint', + value: gettext('Intel vIOMMU needs the q35 machine type'), + hidden: true, + }, ], }); -- 2.39.2