From: Dominik Csapak <d.csapak@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Markus Frank <m.frank@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager] ui: MachineEdit with viommu checkbox
Date: Mon, 24 Oct 2022 16:22:11 +0200 [thread overview]
Message-ID: <a948b905-0aa9-aa5f-ceb0-805b1f62d10e@proxmox.com> (raw)
In-Reply-To: <20220921090748.47445-5-m.frank@proxmox.com>
comments inline:
On 9/21/22 11:07, Markus Frank wrote:
> Added a Checkbox to enable viommu, if q35 is selected.
> Otherwise (i440fx) the checkbox is disabled.
>
> 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 | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/www/manager6/qemu/MachineEdit.js b/www/manager6/qemu/MachineEdit.js
> index f928c80c..25661106 100644
> --- a/www/manager6/qemu/MachineEdit.js
> +++ b/www/manager6/qemu/MachineEdit.js
> @@ -17,6 +17,12 @@ Ext.define('PVE.qemu.MachineInputPanel', {
> let type = value === 'q35' ? 'q35' : 'i440fx';
> store.clearFilter();
> store.addFilter(val => val.data.id === 'latest' || val.data.type === type);
> + if (type === 'i440fx') {
> + me.lookup('viommu').setValue(false);
> + me.lookup('viommu').setDisabled(true);
> + } else {
> + me.lookup('viommu').setDisabled(false);
> + }
> if (!me.getView().isWindows) {
> version.setValue('latest');
> } else {
> @@ -40,12 +46,17 @@ Ext.define('PVE.qemu.MachineInputPanel', {
> delete values.delete;
> }
> delete values.version;
> + if (values.viommu) values.machine += ",viommu=1";
not really our style. we want {} and multiline if statements, see
https://pve.proxmox.com/wiki/Javascript_Style_Guide
> + delete values.viommu;
> return values;
> },
>
> setValues: function(values) {
> let me = this;
>
> + let machine_conf = PVE.Parser.parsePropertyString(values.machine, "type");
> + values.machine = machine_conf.type;
> +
> me.isWindows = values.isWindows;
> if (values.machine === 'pc') {
> values.machine = '__default__';
> @@ -54,10 +65,14 @@ Ext.define('PVE.qemu.MachineInputPanel', {
> if (me.isWindows) {
> if (values.machine === '__default__') {
> values.version = 'pc-i440fx-5.1';
> + values.viommu = false;
> } else if (values.machine === 'q35') {
> values.version = 'pc-q35-5.1';
> }
> }
> +
> + values.viommu = machine_conf.viommu === "1";
> +
> if (values.machine !== '__default__' && values.machine !== 'q35') {
> values.version = values.machine;
> values.machine = values.version.match(/q35/) ? 'q35' : '__default__';
> @@ -108,6 +123,12 @@ Ext.define('PVE.qemu.MachineInputPanel', {
> },
> },
> },
> + {
> + xtype: 'proxmoxcheckbox',
> + fieldLabel: gettext('vIOMMU'),
> + name: 'viommu',
> + reference: 'viommu',
> + },
> {
> xtype: 'displayfield',
> fieldLabel: gettext('Note'),
next prev parent reply other threads:[~2022-10-24 14:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-21 9:07 [pve-devel] [PATCH qemu-server 0/3] vIOMMU-Feature Markus Frank
2022-09-21 9:07 ` [pve-devel] [PATCH qemu-server 1/3] tests: replaced somemachine&someothermachine with q35&pc Markus Frank
2022-09-21 9:07 ` [pve-devel] [PATCH qemu-server 2/3] fix #3784: Parameter for guest vIOMMU & machine as property-string Markus Frank
2022-10-24 14:19 ` Dominik Csapak
2022-09-21 9:07 ` [pve-devel] [PATCH qemu-server 3/3] added test-cases for new machine-syntax & viommu Markus Frank
2022-10-24 14:20 ` Dominik Csapak
2022-09-21 9:07 ` [pve-devel] [PATCH manager] ui: MachineEdit with viommu checkbox Markus Frank
2022-10-24 14:22 ` Dominik Csapak [this message]
2022-10-24 14:28 ` [pve-devel] [PATCH qemu-server 0/3] vIOMMU-Feature Aaron Lauterer
-- strict thread matches above, loose matches on Subject: below --
2022-05-03 11:18 [pve-devel] [PATCH qemu-server 1/3] tests: replaced somemachine&someothermachine with q35&pc Markus Frank
2022-05-03 11:19 ` [pve-devel] [PATCH manager] ui: MachineEdit with viommu checkbox Markus Frank
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=a948b905-0aa9-aa5f-ceb0-805b1f62d10e@proxmox.com \
--to=d.csapak@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