From 7fe2d6c3677bf2da0539ab8ac1d8b1d05c6531cf Mon Sep 17 00:00:00 2001 From: grossmj Date: Sat, 28 Feb 2015 15:53:21 -0700 Subject: [PATCH] Support to deactivate sparsemem or mmap globally for Dynamips VMs. --- gns3server/modules/dynamips/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gns3server/modules/dynamips/__init__.py b/gns3server/modules/dynamips/__init__.py index 6f2f60b1..5faa2e29 100644 --- a/gns3server/modules/dynamips/__init__.py +++ b/gns3server/modules/dynamips/__init__.py @@ -496,6 +496,14 @@ class Dynamips(BaseManager): if vm.slots[0].wics and vm.slots[0].wics[wic_slot_id]: yield from vm.uninstall_wic(wic_slot_id) + mmap_support = self.config.get_section_config("Dynamips").getboolean("mmap_support", True) + if mmap_support is False: + yield from vm.set_mmap(False) + + sparse_memory_support = self.config.get_section_config("Dynamips").getboolean("sparse_memory_support", True) + if sparse_memory_support is False: + yield from vm.set_sparsemem(False) + # update the configs if needed yield from self.create_vm_configs(vm, settings.get("startup_config_content"), settings.get("private_config_content"))