qemu-kvm: fix segfault when running kvm without /dev/kvmqemu-0.10.92-1.fc12qemu-0.10.92-2.fc12qemu-0.10.92-3.fc12
commit00782050707fbb999bfffe722794490d2211a0a9
authorDustin Kirkland <kirkland@canonical.com>
Fri, 4 Sep 2009 19:38:30 +0000 (4 14:38 -0500)
committerMark McLoughlin <markmc@redhat.com>
Mon, 7 Sep 2009 13:52:12 +0000 (7 14:52 +0100)
tree52a7e5969cf3a17fb21d686e1cda1d3aaaf7fdba
parent0b341eda83cd2f01134d5b13300d97c07a3abced
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
vl.c