[PATCH qemu-server v3 07/17] cpu config: set 'type' field before writing

Arthur Bied-Charreton
2026-04-30T15:36:46Z

Fix write_config by adding 'type' to every section, otherwise SectionConfig
fails, because it requires each entry in $cfg->{ids} to have a 'type'
key.

Signed-off-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
---
src/PVE/QemuServer/CPUConfig.pm | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/PVE/QemuServer/CPUConfig.pm b/src/PVE/QemuServer/CPUConfig.pm
index 78603acc..b606aaa5 100644
--- a/src/PVE/QemuServer/CPUConfig.pm
+++ b/src/PVE/QemuServer/CPUConfig.pm
@@ -537,6 +537,7 @@ sub write_config {

# saved in section header
delete $model_conf->{cputype};
+ $model_conf->{type} = $class->type();
}

$class->SUPER::write_config($filename, $cfg);
--
2.47.3