mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 14:31:13 +02:00
Support for console type "none".
This commit is contained in:
1 parent
54661c50b2
commit
e52775fa3a
28 files changed
+213
-85
No files matched your search
@@ -53,9 +53,9 @@ class VirtualBoxVM(BaseNode):
|
||||
VirtualBox VM implementation.
|
||||
"""
|
||||
|
||||
def __init__(self, name, node_id, project, manager, vmname, linked_clone=False, console=None, adapters=0):
|
||||
def __init__(self, name, node_id, project, manager, vmname, linked_clone=False, console=None, console_type="telnet", adapters=0):
|
||||
|
||||
super().__init__(name, node_id, project, manager, console=console, linked_clone=linked_clone, console_type="telnet")
|
||||
super().__init__(name, node_id, project, manager, console=console, linked_clone=linked_clone, console_type=console_type)
|
||||
|
||||
self._maximum_adapters = 8
|
||||
self._system_properties = {}
|
||||
@@ -940,12 +940,14 @@ class VirtualBoxVM(BaseNode):
|
||||
"""
|
||||
Starts remote console support for this VM.
|
||||
"""
|
||||
self._remote_pipe = yield from asyncio_open_serial(self._get_pipe_name())
|
||||
server = AsyncioTelnetServer(reader=self._remote_pipe,
|
||||
writer=self._remote_pipe,
|
||||
binary=True,
|
||||
echo=True)
|
||||
self._telnet_server = yield from asyncio.start_server(server.run, self._manager.port_manager.console_host, self.console)
|
||||
|
||||
if self.console and self.console_type == "telnet":
|
||||
self._remote_pipe = yield from asyncio_open_serial(self._get_pipe_name())
|
||||
server = AsyncioTelnetServer(reader=self._remote_pipe,
|
||||
writer=self._remote_pipe,
|
||||
binary=True,
|
||||
echo=True)
|
||||
self._telnet_server = yield from asyncio.start_server(server.run, self._manager.port_manager.console_host, self.console)
|
||||
|
||||
@asyncio.coroutine
|
||||
def _stop_remote_console(self):
|
||||
@@ -958,6 +960,19 @@ class VirtualBoxVM(BaseNode):
|
||||
self._remote_pipe.close()
|
||||
self._telnet_server = None
|
||||
|
||||
@BaseNode.console_type.setter
|
||||
def console_type(self, new_console_type):
|
||||
"""
|
||||
Sets the console type for this VirtualBox VM.
|
||||
|
||||
:param new_console_type: console type (string)
|
||||
"""
|
||||
|
||||
if self.is_running() and self.console_type != new_console_type:
|
||||
raise VirtualBoxError('"{name}" must be stopped to change the console type to {new_console_type}'.format(name=self._name, new_console_type=new_console_type))
|
||||
|
||||
super(VirtualBoxVM, VirtualBoxVM).console_type.__set__(self, new_console_type)
|
||||
|
||||
@asyncio.coroutine
|
||||
def adapter_add_nio_binding(self, adapter_number, nio):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user