all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>,
	Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server 5/8] machine: incorporate pve machine version when pinning windows guests
Date: Fri, 7 Mar 2025 11:06:16 +0100	[thread overview]
Message-ID: <e3a48a7e-2de7-475f-9e5b-f09f935e0478@proxmox.com> (raw)
In-Reply-To: <b10238dc-987d-4986-8ec2-ca662a91b47c@proxmox.com>

Am 07.03.25 um 10:58 schrieb Dominik Csapak:
> On 3/6/25 15:32, Fiona Ebner wrote:
>> Am 06.03.25 um 11:44 schrieb Dominik Csapak:
>>> When creating or updating guests with ostype windows, we want to pin the
>>> machine version to a specific one. Since introduction of that feature,
>>> we never bumped the pve machine version, so this was missing.
>>>
>>> Append the pve machine version if it's not 0 so we don't add that
>>> unnecessarily.
>>>
>>> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
>>> ---
>>>   PVE/QemuServer/Machine.pm | 12 +++++++++++-
>>>   1 file changed, 11 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/PVE/QemuServer/Machine.pm b/PVE/QemuServer/Machine.pm
>>> index e3da8e21..ebaf2dcc 100644
>>> --- a/PVE/QemuServer/Machine.pm
>>> +++ b/PVE/QemuServer/Machine.pm
>>> @@ -274,7 +274,17 @@ sub check_and_pin_machine_string {
>>>       if (!$machine || $machine =~ m/^(?:pc|q35|virt)$/) {
>>>       # always pin Windows' machine version on create, they get
>>> confused too easily
>>>       if (PVE::QemuServer::Helpers::windows_version($ostype)) {
>>> -        $machine_conf->{type} =
>>> windows_get_pinned_machine_version($machine);
>>> +        my $kvmversion = PVE::QemuServer::Helpers::kvm_user_version();
>>> +        my $pin_version = get_installed_machine_version($kvmversion);
>>
>> Nit: I'd call this $base_version like the argument it's passed-in as.
>> It's not necessarily the version that is going to be pinned.
> 
> sure>
>>> +
>>> +        # pin to the current pveX version to make use of most
>>> current features if > 0
>>> +        my $pvever = get_pve_version($kvmversion);
>>> +        if ($pvever > 0) {
>>> +        $pin_version .= "+pve$pvever";
>>> +        }
>>
>> I feel this logic should go into windows_get_pinned_machine_version()
>> itself.
>>
> 
> if we'd do that, we'd automatically get the newest pve version for the
> windows workaround in
> get_vm_machine, which is the reverse you suggested IIUC ? (e.g. use pve0
> in that case)
> and using a parameter to control that seem weird for this one call...
> 

Depends on where exactly you do it. If you do it in the branch when you
don't have an explicitly passed-in base version then you don't affect
that caller (except if too old QEMU binary, but that is even more of an
edge case and I don't see a reason not to use the newest pve version
then if we already need to use a pre-creation version).


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

  reply	other threads:[~2025-03-07 10:06 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-06 10:44 [pve-devel] [PATCH qemu-server 0/8] disable S3/S4 power states by default Dominik Csapak
2025-03-06 10:44 ` [pve-devel] [RFC PATCH qemu-server 1/8] tests: cfg2cmd: pin QEMU version Dominik Csapak
2025-03-06 12:00   ` Fiona Ebner
2025-03-06 12:07     ` Dominik Csapak
2025-03-06 12:43       ` Fiona Ebner
2025-03-06 10:44 ` [pve-devel] [PATCH qemu-server 2/8] config to command: add one '-global' option for each flag Dominik Csapak
2025-03-06 12:13   ` Fiona Ebner
2025-03-06 12:15     ` Dominik Csapak
2025-03-06 12:55       ` Fiona Ebner
2025-03-07  9:54         ` Dominik Csapak
2025-03-07 10:00           ` Fiona Ebner
2025-03-07 10:05             ` Dominik Csapak
2025-03-07 10:14               ` Fiona Ebner
2025-03-06 10:44 ` [pve-devel] [PATCH qemu-server 3/8] meta info: also add current pve-machine version Dominik Csapak
2025-03-06 10:44 ` [pve-devel] [PATCH qemu-server 4/8] machine: correctly select pve machine version for non pinned windows guests Dominik Csapak
2025-03-06 13:10   ` Fiona Ebner
2025-03-06 13:36     ` Dominik Csapak
2025-03-06 14:10       ` Fiona Ebner
2025-03-06 14:14         ` Fiona Ebner
2025-03-06 14:15         ` Dominik Csapak
2025-03-06 14:20           ` Fiona Ebner
2025-03-07  9:55             ` Dominik Csapak
2025-03-06 10:44 ` [pve-devel] [PATCH qemu-server 5/8] machine: incorporate pve machine version when pinning " Dominik Csapak
2025-03-06 14:32   ` Fiona Ebner
2025-03-07  9:58     ` Dominik Csapak
2025-03-07 10:06       ` Fiona Ebner [this message]
2025-03-06 10:44 ` [pve-devel] [PATCH qemu-server 6/8] machine: add S3/S4 power state properties Dominik Csapak
2025-03-06 14:52   ` Fiona Ebner
2025-03-07 10:02     ` Dominik Csapak
2025-03-07 10:10       ` Fiona Ebner
2025-03-06 10:44 ` [pve-devel] [PATCH qemu-server 7/8] machine: bump pve machine version and reverse the s3/s4 defaults Dominik Csapak
2025-03-06 15:04   ` Fiona Ebner
2025-03-06 10:44 ` [pve-devel] [PATCH qemu-server 8/8] tests: cfg2cmd: add test for windows machine pinning from meta info Dominik Csapak
2025-03-06 15:10   ` Fiona Ebner
2025-03-07 14:46 ` [pve-devel] [PATCH qemu-server 0/8] disable S3/S4 power states by default Dominik Csapak

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=e3a48a7e-2de7-475f-9e5b-f09f935e0478@proxmox.com \
    --to=f.ebner@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal