public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Jakob Klocker" <j.klocker@proxmox.com>
To: "Dominik Csapak" <d.csapak@proxmox.com>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH manager v2] fix #7896: ui: qemu: show effective machine version for Windows guests
Date: Mon, 31 Aug 2026 09:11:37 +0200	[thread overview]
Message-ID: <DL2XX88O92GD.12UZ8WKZO4RT3@proxmox.com> (raw)
In-Reply-To: <382da81b-b48b-4047-9fb0-a9d355573902@proxmox.com>

On Wed Aug 26, 2026 at 10:36 AM CEST, Dominik Csapak wrote:
> one comment inline
>
> On 8/24/26 3:01 PM, Jakob Klocker wrote:
> [snip]
>>               q35: (get) => get('type') === 'q35',
>> @@ -102,10 +104,21 @@ Ext.define('PVE.qemu.MachineInputPanel', {
>>           }
>>   
>>           if (me.isWindows) {
>> -            if (values.machine === '__default__') {
>> -                values.version = 'pc-i440fx-5.1';
>> -            } else if (values.machine === 'q35') {
>> -                values.version = 'pc-q35-5.1';
>> +            if (values.machine === '__default__' || values.machine === 'q35') {
>> +                let effective = PVE.Utils.qemu_implicit_machine_version(
>> +                    values.machine,
>> +                    values.creationQemu,
>> +                    values.arch,
>> +                );
>> +                me.getViewModel().set({
>> +                    effectiveVersionLabel: effective + ' ' + gettext('(implicit)'),
>> +                    implicitVersion: true,
>> +                });
>> +                me.setAdvancedVisible(true);
>
>
>> +                // flush the binding, then re-baseline the reset value to it
>> +                // otherwise the Reset button reverts to the field's empty initial value
>> +                me.getViewModel().notify();
>> +                me.lookup('effectiveVersion').resetOriginalValue();
>
> under which circumstances is this necessary?
>
> even with those two statements deleted, i can't trigger it to have
> the reset button enabled?
>
> in general, we probably shouldn't mess with the 'resetOriginalValue' too
> much, but if we do, having the steps where this is necessary
> would be good (does not have to be a comment, in the commit message is
> fine for me)
Than for taking a look at the patch.

I'm not quite sure what you mean with 'reset button enabled'. The reset
button enables just like in other UI forms; in the Machine case that's 
when you select a different value in the dropdowns (e.g. change 
`Machine`, `Version` or `vIOMMU`). I'm talking about the 
`Reset from Data` button on the top right.

The `resetOriginalValue` is necessary because the 
`effectiveVersionLabel` value is empty on page load, and only gets set
when `setValues` is called. Since `setValues` is not called on a reset,
this would display an empty current version on a reset. Therefore I 
replace the field's empty initial value with the actual current version
on page load, so a reset reverts to the correct value instead of an
empty one.

I thought adding the comment above the code, saying that on reset the
value is empty made this clear -- if not, I can mention why exactly I
used this in the commit message as well.




  reply	other threads:[~2026-08-31  7:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 13:01 [PATCH manager v2] fix #7896: ui: qemu: show effective machine version for Windows guests Jakob Klocker
2026-08-26  8:36 ` Dominik Csapak
2026-08-31  7:11   ` Jakob Klocker [this message]
2026-08-31  8:03     ` Dominik Csapak
2026-08-31  8:42       ` Jakob Klocker
2026-08-31  9:48 ` superseded: " Jakob Klocker

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=DL2XX88O92GD.12UZ8WKZO4RT3@proxmox.com \
    --to=j.klocker@proxmox.com \
    --cc=d.csapak@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal