qemu-kvm: fix segfault when running kvm without /dev/kvmqemu-0.10.92-4.fc12
commit70415c7d31bf6420d1a2d685fe14661ce1cfd9cb
authorDustin Kirkland <kirkland@canonical.com>
Fri, 4 Sep 2009 19:38:30 +0000 (4 14:38 -0500)
committerMark McLoughlin <markmc@redhat.com>
Wed, 16 Sep 2009 22:16:24 +0000 (16 23:16 +0100)
tree50eaf58d7a5461fe8292547908e59c3e4287f5c2
parent80380f566e2c1d4c9e02e0c0dff405ecc86d134e
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