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

Fiona Ebner
2026-05-07T12:25:01Z

Am 30.04.26 um 6:00 PM schrieb Arthur Bied-Charreton:
> 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();

Maybe we should rather call check_config() in the API endpoints like
other section config users do? Or would that not work nicely here?

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