This is picked up from an old series [0] by Stefan Reiter. As of before this series, the only way to create custom CPU models is by editing `/etc/pve/virtual-guest/cpu-models.conf` manually.
This can be cumbersome for a few reasons, e.g., due to the fact that flags misconfigurations are only caught when starting the VM. `cpu-flags` endpoint: The `cpu-flags` endpoint previously returned a list of hardcoded flags, which is both non-exhaustive (some flags I should be able to set are missing), and partly incorrect (some flags my host(s) do not support set are returned). This is limiting and can lead to misconfigurations. The updated endpoint intersects all flags QEMU accepts as `-cpu` arguments with all flags the host hardware/emulation actually supports. This way, if I am able to set a flag in the UI, I can be confident that the VM will actually be able to start. Custom CPU model CRUD functionality: Expose CRUD endpoints and UI flow to interact with `cpu-models.conf`. For each flag, show a list of the cluster nodes supporting it, and only expose flags that at least one node supports to avoid misconfigurations. Filter flags by acceleration type (KVM/TCG). [0] https://lore.proxmox.com/pve-devel/[email protected]/ pve-manager: Arthur Bied-Charreton (5): ui: VMCPUFlagSelector: Fix unknownFlags behaviour ui: CPUModelSelector: Fix dirty state on default ui: CPUModelSelector: Allow filtering out custom models ui: Add basic custom CPU model editor ui: Add CPU flag editor for custom models www/manager6/Makefile | 3 + www/manager6/dc/CPUTypeEdit.js | 99 ++++++++++++++++ www/manager6/dc/CPUTypeView.js | 139 ++++++++++++++++++++++ www/manager6/dc/Config.js | 6 + www/manager6/form/CPUModelSelector.js | 18 ++- www/manager6/form/PhysBitsSelector.js | 153 +++++++++++++++++++++++++ www/manager6/form/VMCPUFlagSelector.js | 135 ++++++++++++++++++---- 7 files changed, 529 insertions(+), 24 deletions(-) create mode 100644 www/manager6/dc/CPUTypeEdit.js create mode 100644 www/manager6/dc/CPUTypeView.js create mode 100644 www/manager6/form/PhysBitsSelector.js qemu-server: Arthur Bied-Charreton (3): qemu: Add helpers for new custom models endpoints api: qemu: Extend cpu-flags endpoint to return actually supported flags api: qemu: Add CRUD handlers for custom CPU models src/PVE/API2/Qemu/CPU.pm | 236 +++++++++++++++++++++++++++++++- src/PVE/API2/Qemu/CPUFlags.pm | 108 ++++++++++++++- src/PVE/QemuServer/CPUConfig.pm | 35 ++++- 3 files changed, 374 insertions(+), 5 deletions(-) Summary over all repositories: 10 files changed, 903 insertions(+), 29 deletions(-) -- Generated by murpp 0.9.0
