]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Enable KVM when probing capabilities
authorJiri Denemark <jdenemar@redhat.com>
Fri, 10 Jun 2016 15:16:21 +0000 (17:16 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 25 Nov 2016 19:34:26 +0000 (20:34 +0100)
commit25ba9c31f50fd021afb3565ac7dd8062dd689ceb
tree869b00c844c72561bc4a9463579879dbf5507f83
parent73078906f355115611d943796307037a180caeec
qemu: Enable KVM when probing capabilities

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@redhat.com>
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.h
src/qemu/qemu_capspriv.h
tests/qemucapabilitiestest.c