Re: [PATCH qemu-server v4 06/17] cpu: register standard option for CPU format

Fiona Ebner
2026-05-07T14:09:08Z

Am 07.05.26 um 3:59 PM schrieb Arthur Bied-Charreton:
> On Thu, May 07, 2026 at 02:11:13PM +0200, Fiona Ebner wrote:
>> Am 30.04.26 um 6:00 PM schrieb Arthur Bied-Charreton:
>>> Expose $cpu_fmt as a standard option to allow using it in endpoint
>>> definitions.
>>>
>>> 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 65ced94f..78603acc 100644
>>> --- a/src/PVE/QemuServer/CPUConfig.pm
>>> +++ b/src/PVE/QemuServer/CPUConfig.pm
>>> @@ -344,6 +344,7 @@ my $cpu_fmt = {
>>> optional => 1,
>>> },
>>> };
>>> +PVE::JSONSchema::register_standard_option('pve-qemu-cpu', $cpu_fmt);
>>
>> I wanted to say: all the others for QEMU use pve-qm-*, so we should
>> stick to that. But actually, there already is pve-qemu-machine as an
>> exception, so meh. Might still be better to stick to the more common prefix.
>>
> I agree, the problem is just that QemuServer.pm:855 already registers
> pve-qm-cpu:
>
> ```
> while (my ($k, $v) = each %$confdesc) {
> PVE::JSONSchema::register_standard_option("pve-qm-$k", $v);
> }
> ```

Aha!

>
> AFAICT, no other part of the code depends on that. We could just remove
> that, or maybe append some prefix to the new pve-qm-cpu, like
> pve-qm-cpu-conf?

What do you think about 'pve-qm-custom-cpu-model'? Hopefully reduces the
confusion.

>
>>>
>>> my $sev_fmt = {
>>> type => {
>>