mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Prevent starting different hypervisors that leverage hardware virtualization (VT-x/AMD-V). Fixes #548.
This commit is contained in:
1 parent
eb5e019a26
commit
fcd4fda68e
5 files changed
+25
-14
No files matched your search
@@ -152,7 +152,7 @@ class QEMUHandler:
|
||||
and "-no-kvm" not in vm.options:
|
||||
pm = ProjectManager.instance()
|
||||
if pm.check_hardware_virtualization(vm) is False:
|
||||
raise HTTPConflict(text="Cannot start VM with KVM enabled because hardware virtualization is already used by another software like VMware or VirtualBox")
|
||||
raise HTTPConflict(text="Cannot start VM with KVM enabled because hardware virtualization (VT-x/AMD-V) is already used by another software like VMware or VirtualBox")
|
||||
yield from vm.start()
|
||||
response.set_status(204)
|
||||
|
||||
|
||||
@@ -192,10 +192,10 @@ class VirtualBoxHandler:
|
||||
|
||||
vbox_manager = VirtualBox.instance()
|
||||
vm = vbox_manager.get_vm(request.match_info["vm_id"], project_id=request.match_info["project_id"])
|
||||
if sys.platform.startswith("linux") and (yield from vm.check_hw_virtualization()):
|
||||
if (yield from vm.check_hw_virtualization()):
|
||||
pm = ProjectManager.instance()
|
||||
if pm.check_hardware_virtualization(vm) is False:
|
||||
raise HTTPConflict(text="Cannot start VM because KVM is being used by a Qemu VM")
|
||||
raise HTTPConflict(text="Cannot start VM because hardware virtualization (VT-x/AMD-V) is already used by another software like VMware or KVM (on Linux)")
|
||||
yield from vm.start()
|
||||
response.set_status(204)
|
||||
|
||||
|
||||
@@ -160,6 +160,10 @@ class VMwareHandler:
|
||||
|
||||
vmware_manager = VMware.instance()
|
||||
vm = vmware_manager.get_vm(request.match_info["vm_id"], project_id=request.match_info["project_id"])
|
||||
if vm.check_hw_virtualization():
|
||||
pm = ProjectManager.instance()
|
||||
if pm.check_hardware_virtualization(vm) is False:
|
||||
raise HTTPConflict(text="Cannot start VM because hardware virtualization (VT-x/AMD-V) is already used by another software like VirtualBox or KVM (on Linux)")
|
||||
yield from vm.start()
|
||||
response.set_status(204)
|
||||
|
||||
|
||||
Reference in new issue
Block a user