From d9745644cd2cc720b1a4a92b4db8079bd0b212e0 Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 24 Jun 2015 23:03:04 -0600 Subject: [PATCH] Check for /dev/kvm. Fixes #245. --- gns3server/modules/qemu/qemu_vm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gns3server/modules/qemu/qemu_vm.py b/gns3server/modules/qemu/qemu_vm.py index e823c8cc..30ec03f8 100644 --- a/gns3server/modules/qemu/qemu_vm.py +++ b/gns3server/modules/qemu/qemu_vm.py @@ -1203,6 +1203,8 @@ class QemuVM(BaseVM): command.extend(["-name", self._name]) command.extend(["-m", str(self._ram)]) if sys.platform.startswith("linux") and self.manager.config.get_section_config("Qemu").getboolean("enable_kvm", True): + if not os.path.exists("/dev/kvm"): + raise QemuError("KVM acceleration cannot be used (/dev/kvm doesn't exist)") command.extend(["-enable-kvm"]) disk_options = yield from self._disk_options() command.extend(disk_options)