From 7c49a9160c88dee838b3e9934536eb828db3d06e Mon Sep 17 00:00:00 2001 From: grossmj Date: Mon, 30 Oct 2023 14:57:11 +1000 Subject: [PATCH] Allow disabling hardware virtualization check --- conf/gns3_server.conf | 3 +++ gns3server/compute/project_manager.py | 17 ++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/conf/gns3_server.conf b/conf/gns3_server.conf index 013ba7dd..eb94aaa9 100644 --- a/conf/gns3_server.conf +++ b/conf/gns3_server.conf @@ -62,6 +62,9 @@ default_nat_interface = vmnet10 ; Enable the built-in templates enable_builtin_templates = True +; check if hardware virtualization is used by other emulators (KVM, VMware or VirtualBox) +hardware_virtualization_check = True + [VPCS] ; VPCS executable location, default: search in PATH ;vpcs_path = vpcs diff --git a/gns3server/compute/project_manager.py b/gns3server/compute/project_manager.py index 5ed61542..0b2d5377 100644 --- a/gns3server/compute/project_manager.py +++ b/gns3server/compute/project_manager.py @@ -16,12 +16,14 @@ # along with this program. If not, see . import aiohttp -import asyncio import psutil import platform + from .project import Project +from ..config import Config from uuid import UUID + import logging log = logging.getLogger(__name__) @@ -128,10 +130,11 @@ class ProjectManager: :returns: boolean """ - for project in self._projects.values(): - for node in project.nodes: - if node == source_node: - continue - if node.hw_virtualization and node.__class__.__name__ != source_node.__class__.__name__: - return False + if Config.instance().get_section_config("Server").getboolean("hardware_virtualization_check", True): + for project in self._projects.values(): + for node in project.nodes: + if node == source_node: + continue + if node.hw_virtualization and node.__class__.__name__ != source_node.__class__.__name__: + return False return True