On Mon, Nov 21, 2016 at 12:21:01AM +0100, Jiri Denemark wrote:
CPU related capabilities may differ depending on accelerator used
when
probing. Let's use KVM if available when probing QEMU and fall back to
TCG. The created capabilities already contain all we need to distinguish
whether KVM or TCG was used:
- KVM was used when probing capabilities:
QEMU_CAPS_KVM is set
QEMU_CAPS_ENABLE_KVM is not set
- TCG was used and QEMU supports KVM, but it failed (e.g., missing
kernel module or wrong /dev/kvm permissions)
QEMU_CAPS_KVM is not set
QEMU_CAPS_ENABLE_KVM is set
- KVM was not used and QEMU does not support it
QEMU_CAPS_KVM is not set
QEMU_CAPS_ENABLE_KVM is not set
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 45 +++++++++++++++++++++++++++++++++++++++++---
src/qemu/qemu_capabilities.h | 3 ---
src/qemu/qemu_capspriv.h | 8 ++++++++
tests/qemucapabilitiestest.c | 5 +++++
4 files changed, 55 insertions(+), 6 deletions(-)
ACK
Pavel