]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: allow hypervisor-cpu-baseline with single cpu
authorCollin Walling <walling@linux.ibm.com>
Fri, 25 Sep 2020 00:22:39 +0000 (20:22 -0400)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 24 Nov 2020 20:04:07 +0000 (21:04 +0100)
commitd1e00f84c07903b46194097e68b4f2cd6897ec8a
tree7c82bb0c31a4803aab7b9ce47f9fbae75f16e217
parentc5ed1fdee234788c28d1c1b156f2a2b4498f17e4
qemu: allow hypervisor-cpu-baseline with single cpu

When executing the hypervisor-cpu-baseline command and if there is
only a single CPU definition present in the XML file, then the
baseline handler will exit early and libvirt will print an unhelpful
message:

"error: An error occurred, but the cause is unknown"

This is due to no CPU definition ever being "baselined", since the
handler expects at least two CPU models.

Let's fix this by performing a CPU model expansion on the single CPU
definition and returning the result to the caller. This will also
ensure the CPU model's feature set is sane if any were provided in
the file.

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_driver.c