From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Markus Frank <m.frank@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager v9 3/3] ui: machine: add viommu ComboBox
Date: Thu, 11 Apr 2024 17:13:50 +0200 [thread overview]
Message-ID: <ca746021-8520-4360-9de8-48e40797f660@proxmox.com> (raw)
In-Reply-To: <20240411104822.832432-4-m.frank@proxmox.com>
On 11/04/2024 12:48, Markus Frank wrote:
> 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 <m.frank@proxmox.com>
> ---
> 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',
nit: this could be done in a separate patch.
>
> controller: {
> xclass: 'Ext.app.ViewController',
> @@ -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;
can't we use printPropertyString here (with a bit less code preparing the object
passed to it), or at least try making it a bit less convoluted..
> 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'),
maybe we could mark the field invalid (if that text is returned in the
validity check it will be shown as tooltip) instead of using the hint?
> + hidden: true,
> + },
> ],
> });
>
prev parent reply other threads:[~2024-04-11 15:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-11 10:48 [pve-devel] [PATCH qemu-server/docs/manager v9 0/3] vIOMMU-Feature #3784 Markus Frank
2024-04-11 10:48 ` [pve-devel] [PATCH qemu-server v9 1/3] fix #3784: config: Parameter for guest vIOMMU + test-cases Markus Frank
2024-04-11 14:44 ` [pve-devel] applied: " Thomas Lamprecht
2024-04-11 10:48 ` [pve-devel] [PATCH docs v9 2/3] add vIOMMU documentation Markus Frank
2024-04-11 14:47 ` [pve-devel] applied: " Thomas Lamprecht
2024-04-11 10:48 ` [pve-devel] [PATCH manager v9 3/3] ui: machine: add viommu ComboBox Markus Frank
2024-04-11 15:13 ` Thomas Lamprecht [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ca746021-8520-4360-9de8-48e40797f660@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=m.frank@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox