From 75890c8f5a0f494f7c536c6c97f296d1977df36e Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 17 Nov 2016 10:38:29 +0100 Subject: [PATCH] Prevent double start of VirtualBox VM and VMware VM Fix https://github.com/GNS3/gns3-gui/issues/1664 --- gns3server/compute/virtualbox/virtualbox_vm.py | 3 +++ gns3server/compute/vmware/vmware_vm.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/gns3server/compute/virtualbox/virtualbox_vm.py b/gns3server/compute/virtualbox/virtualbox_vm.py index 32e59756..a691bf1c 100644 --- a/gns3server/compute/virtualbox/virtualbox_vm.py +++ b/gns3server/compute/virtualbox/virtualbox_vm.py @@ -206,6 +206,9 @@ class VirtualBoxVM(BaseNode): Starts this VirtualBox VM. """ + if self.status == "started": + return + # resume the VM if it is paused vm_state = yield from self._get_vm_state() if vm_state == "paused": diff --git a/gns3server/compute/vmware/vmware_vm.py b/gns3server/compute/vmware/vmware_vm.py index de3c7333..bbf6ac00 100644 --- a/gns3server/compute/vmware/vmware_vm.py +++ b/gns3server/compute/vmware/vmware_vm.py @@ -386,6 +386,9 @@ class VMwareVM(BaseNode): Starts this VMware VM. """ + if self.status == "started": + return + if (yield from self.is_running()): raise VMwareError("The VM is already running in VMware")