1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Check for /dev/kvm. Fixes #245.

This commit is contained in:
grossmj 2015-06-24 23:03:04 -06:00
parent ed95bcee97
commit d9745644cd

View File

@ -1203,6 +1203,8 @@ class QemuVM(BaseVM):
command.extend(["-name", self._name]) command.extend(["-name", self._name])
command.extend(["-m", str(self._ram)]) command.extend(["-m", str(self._ram)])
if sys.platform.startswith("linux") and self.manager.config.get_section_config("Qemu").getboolean("enable_kvm", True): 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"]) command.extend(["-enable-kvm"])
disk_options = yield from self._disk_options() disk_options = yield from self._disk_options()
command.extend(disk_options) command.extend(disk_options)