Save state feature for VirtualBox and VMware. New "On close" setting to

select the action to execute when closing/stopping a Qemu/VirtualBox/VMware VM.
This commit is contained in:
grossmj committed 2018-03-30 21:18:44 +07:00
1 parent 3d1ee4da3f
commit ea0009db6c
9 files changed
+100 -112

No files matched your search

+1 -1
View File
@@ -123,7 +123,7 @@ class Controller:
for vm in vms:
# remove deprecated properties
for prop in vm.copy():
if prop in ["enable_remote_console", "use_ubridge"]:
if prop in ["enable_remote_console", "use_ubridge", "acpi_shutdown"]:
del vm[prop]
# remove deprecated default_symbol and hover_symbol
+24 -1
View File
@@ -37,7 +37,7 @@ import logging
log = logging.getLogger(__name__)
GNS3_FILE_FORMAT_REVISION = 8
GNS3_FILE_FORMAT_REVISION = 9
def _check_topology_schema(topo):
@@ -151,6 +151,10 @@ def load_topology(path):
if topo["revision"] < 8:
topo = _convert_2_0_0(topo, path)
# Version before GNS3 2.1
if topo["revision"] < 9:
topo = _convert_2_1_0(topo, path)
try:
_check_topology_schema(topo)
except aiohttp.web.HTTPConflict as e:
@@ -166,6 +170,25 @@ def load_topology(path):
return topo
def _convert_2_1_0(topo, topo_path):
"""
Convert topologies from GNS3 2.1.x to 2.2
Changes:
* Removed acpi_shutdown option from Qemu, VMware and VirtualBox
"""
topo["revision"] = 9
for node in topo.get("topology", {}).get("nodes", []):
if "properties" in node:
if node["node_type"] in ("qemu", "vmware", "virtualbox"):
if "acpi_shutdown" in node["properties"]:
del node["properties"]["acpi_shutdown"]
if "save_vm_state" in node["properties"]:
del node["properties"]["save_vm_state"]
return topo
def _convert_2_0_0(topo, topo_path):
"""
Convert topologies from GNS3 2.0.0 to 2.1