mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 06:21:15 +02:00
Refactor aux port allocation
This move the allocation of aux port to the base vm. Also now the free of console port during the close is in the base VM. An aux port is allocated to the docker container but not used for the moment. Ref https://github.com/GNS3/gns3-gui/issues/1039
This commit is contained in:
12 files changed
+190
-132
No files matched your search
@@ -60,7 +60,6 @@ class VirtualBoxVM(BaseVM):
|
||||
self._system_properties = {}
|
||||
self._telnet_server_thread = None
|
||||
self._serial_pipe = None
|
||||
self._closed = False
|
||||
|
||||
# VirtualBox settings
|
||||
self._adapters = adapters
|
||||
@@ -344,14 +343,8 @@ class VirtualBoxVM(BaseVM):
|
||||
Closes this VirtualBox VM.
|
||||
"""
|
||||
|
||||
if self._closed:
|
||||
# VM is already closed
|
||||
return
|
||||
|
||||
log.debug("VirtualBox VM '{name}' [{id}] is closing".format(name=self.name, id=self.id))
|
||||
if self._console:
|
||||
self._manager.port_manager.release_tcp_port(self._console, self._project)
|
||||
self._console = None
|
||||
if not (yield from super().close()):
|
||||
return False
|
||||
|
||||
for adapter in self._ethernet_adapters.values():
|
||||
if adapter is not None:
|
||||
@@ -404,9 +397,6 @@ class VirtualBoxVM(BaseVM):
|
||||
id=self.id,
|
||||
error=e.strerror))
|
||||
|
||||
log.info("VirtualBox VM '{name}' [{id}] closed".format(name=self.name, id=self.id))
|
||||
self._closed = True
|
||||
|
||||
@property
|
||||
def headless(self):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user