ACPI shutdown for GNS3 VM running on Hyper-V. Ref https://github.com/GNS3/gns3-gui/issues/763

This commit is contained in:
grossmj 2018-08-12 17:11:32 +07:00
parent c48eebcc5d
commit 1fd010484d
3 changed files with 4 additions and 3 deletions

View File

@ -77,7 +77,7 @@ class GNS3VM:
"name": "Hyper-V",
"description": 'Hyper-V support (Windows 10/Server 2016 and above). Nested virtualization must be supported and enabled (Intel processor only)',
"support_when_exit": True,
"support_headless": True,
"support_headless": False,
"support_ram": True
}

View File

@ -279,7 +279,7 @@ class BaseGNS3VM:
raise NotImplementedError
@asyncio.coroutine
def stop(self, force=False):
def stop(self):
"""
Stops the GNS3 VM.
"""

View File

@ -33,6 +33,7 @@ class HyperVGNS3VM(BaseGNS3VM):
_HYPERV_VM_STATE_ENABLED = 2
_HYPERV_VM_STATE_DISABLED = 3
_HYPERV_VM_STATE_SHUTDOWN = 4
_HYPERV_VM_STATE_PAUSED = 9
_WMI_JOB_STATUS_STARTED = 4096
@ -283,7 +284,7 @@ class HyperVGNS3VM(BaseGNS3VM):
"""
try:
yield from self._set_state(HyperVGNS3VM._HYPERV_VM_STATE_DISABLED)
yield from self._set_state(HyperVGNS3VM._HYPERV_VM_STATE_SHUTDOWN)
except GNS3VMError as e:
raise GNS3VMError("Failed to stop the GNS3 VM: {}".format(e))
log.info("GNS3 VM has been stopped")