]> git.proxmox.com Git - qemu-server.git/commit - PVE/QemuServer.pm
Add QEMU CPU flag querying helpers
authorStefan Reiter <s.reiter@proxmox.com>
Thu, 21 Nov 2019 14:53:42 +0000 (15:53 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 14 Jan 2020 10:56:21 +0000 (11:56 +0100)
commit05a4c550f334c4a60ea978cc7fc9f1844ea5d06a
tree8db60f3fdfe445366ddd3e780d7eea3e0f896e4a
parenteb5e482ded9ae6aeb6575de9441b79b90a5de531
Add QEMU CPU flag querying helpers

* query_understood_cpu_flags returns all flags that QEMU/KVM knows about
* query_supported_cpu_flags returns all flags that QEMU/KVM can use on
  this particular host.

To get supported flags, a temporary VM is started with QEMU, so we can
issue the "query-cpu-model-expansion" QMP command. This is how libvirt
queries supported flags for its "host-passthrough" CPU type.
query_supported_cpu_flags is thus rather slow and shouldn't be called
unnecessarily.

Note that KVM and TCG accelerators provide different expansions for the
"host" CPU type, so we need to query both.

Currently only supports x86_64, because QEMU-aarch64 doesn't provide the
necessary querying functions.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
PVE/QemuServer.pm