qemu-kvm: fix segfault when running kvm without /dev/kvm
qemu-kvm segfaults on systems without access to /dev/kvm.
The global kvm_allowed is being set too late in vl.c.
This patch moves the kvm initialization a bit higher in the
vl.c main, just after the daemonize fork.
This fix is intended to be a short term solution, solving the
segfaults.
In the longer term, the suggested approach requires a bit more
development and testing:
* If no arg given => try kvm, try kqemu, try tcg
* If --accelmode arg given => try $arg, and fail if unavailable
(cherry picked from commit
c06b44bfc9814930b6a94db7bbeb3be1cd39c0d2)
Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Fedora-patch: qemu-fix-no-kvm-segfault.patch