1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-01 04:38:12 +00:00

Adds -no-kvm to the ASA template and ignore -no-kvm on platforms other than Linux. Should resolve #472.

This commit is contained in:
Jeremy 2015-07-03 23:35:42 -06:00
parent 442aa31065
commit 9235c3a913

View File

@ -483,6 +483,8 @@ class QemuVM(BaseVM):
id=self._id, id=self._id,
options=options)) options=options))
if not sys.platform.startswith("linux") and "-no-kvm" in options:
options = options.replace("-no-kvm")
self._options = options.strip() self._options = options.strip()
@property @property
@ -1177,7 +1179,8 @@ class QemuVM(BaseVM):
command = [self.qemu_path] command = [self.qemu_path]
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) \
and "-no-kvm" not in self._options:
if not os.path.exists("/dev/kvm"): if not os.path.exists("/dev/kvm"):
raise QemuError("KVM acceleration cannot be used (/dev/kvm doesn't exist)") raise QemuError("KVM acceleration cannot be used (/dev/kvm doesn't exist)")
command.extend(["-enable-kvm"]) command.extend(["-enable-kvm"])