all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server 3/3] cpu config: resolve default reported-model on write
Date: Tue, 19 May 2026 16:06:23 +0200	[thread overview]
Message-ID: <20260519140623.594472-4-a.bied-charreton@proxmox.com> (raw)
In-Reply-To: <20260519140623.594472-1-a.bied-charreton@proxmox.com>

When writing the custom CPU model config, fill in the default
reported-model (kvm64) explicitly if not defined.

This makes the default visible in the config file and prepares for
potentially making the field required in a future major release.

Signed-off-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
Suggested-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/QemuServer/CPUConfig.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/PVE/QemuServer/CPUConfig.pm b/src/PVE/QemuServer/CPUConfig.pm
index c8b54ec2..9be145ef 100644
--- a/src/PVE/QemuServer/CPUConfig.pm
+++ b/src/PVE/QemuServer/CPUConfig.pm
@@ -554,6 +554,8 @@ sub write_config($class, $filename, $cfg) {
                 . " $model_conf->{cputype}) not equal to \$cfg->ids entry ($model)\n";
         }
 
+        $model_conf->{'reported-model'} //= $cpu_fmt->{'reported-model'}->{default};
+
         # saved in section header
         delete $model_conf->{cputype};
     }
-- 
2.47.3




  parent reply	other threads:[~2026-05-19 14:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-19 14:06 [PATCH manager/qemu-server 0/3] custom cpu models: tighten reported-model handling Arthur Bied-Charreton
2026-05-19 14:06 ` [PATCH pve-manager 1/3] custom cpu models: make 'reported-model' required in POST Arthur Bied-Charreton
2026-05-19 14:06 ` [PATCH pve-manager 2/3] custom cpu models: do not allow deleting 'reported-model' Arthur Bied-Charreton
2026-05-19 14:06 ` Arthur Bied-Charreton [this message]
2026-05-19 14:50 ` [PATCH manager/qemu-server 0/3] custom cpu models: tighten reported-model handling Fiona Ebner
2026-05-19 19:17 ` applied: " Thomas Lamprecht
2026-05-19 20:17 ` Thomas Lamprecht

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=20260519140623.594472-4-a.bied-charreton@proxmox.com \
    --to=a.bied-charreton@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