Prevent corruption of VM in VirtualBox when using linked clone

Fix https://github.com/GNS3/gns3-gui/issues/1821
This commit is contained in:
Julien Duponchelle committed 2017-01-31 18:58:43 +01:00
1 parent 27a1089806
commit f0ff035c0b
4 files changed
+37 -10

No files matched your search

+2 -2
View File
@@ -161,7 +161,7 @@ class VirtualBox(BaseManager):
continue
@asyncio.coroutine
def list_vms(self):
def list_vms(self, allow_clone=False):
"""
Gets VirtualBox VM list.
"""
@@ -176,7 +176,7 @@ class VirtualBox(BaseManager):
if vmname == "<inaccessible>":
continue # ignore inaccessible VMs
extra_data = yield from self.execute("getextradata", [vmname, "GNS3/Clone"])
if len(extra_data) == 0 or not extra_data[0].strip() == "Value: yes":
if allow_clone or len(extra_data) == 0 or not extra_data[0].strip() == "Value: yes":
# get the amount of RAM
info_results = yield from self.execute("showvminfo", [vmname, "--machinereadable"])
ram = 0