mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-19 04:47:54 +00:00
ACPI shutdown for GNS3 VM running on Hyper-V. Ref https://github.com/GNS3/gns3-gui/issues/763
This commit is contained in:
parent
c48eebcc5d
commit
1fd010484d
@ -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
|
||||
}
|
||||
|
||||
|
@ -279,7 +279,7 @@ class BaseGNS3VM:
|
||||
raise NotImplementedError
|
||||
|
||||
@asyncio.coroutine
|
||||
def stop(self, force=False):
|
||||
def stop(self):
|
||||
"""
|
||||
Stops the GNS3 VM.
|
||||
"""
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user