mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-11 16:41:04 +00:00
Use console_host from the PortManager.
This commit is contained in:
parent
a6869379c3
commit
3472f19519
@ -58,7 +58,6 @@ class IOUVM(BaseVM):
|
|||||||
:param project: Project instance
|
:param project: Project instance
|
||||||
:param manager: parent VM Manager
|
:param manager: parent VM Manager
|
||||||
:param console: TCP console port
|
:param console: TCP console port
|
||||||
:params console_host: TCP console host IP
|
|
||||||
:params ethernet_adapters: Number of ethernet adapters
|
:params ethernet_adapters: Number of ethernet adapters
|
||||||
:params serial_adapters: Number of serial adapters
|
:params serial_adapters: Number of serial adapters
|
||||||
:params ram: Ram MB
|
:params ram: Ram MB
|
||||||
@ -69,7 +68,6 @@ class IOUVM(BaseVM):
|
|||||||
|
|
||||||
def __init__(self, name, vm_id, project, manager,
|
def __init__(self, name, vm_id, project, manager,
|
||||||
console=None,
|
console=None,
|
||||||
console_host="0.0.0.0",
|
|
||||||
ram=None,
|
ram=None,
|
||||||
nvram=None,
|
nvram=None,
|
||||||
ethernet_adapters=None,
|
ethernet_adapters=None,
|
||||||
@ -86,7 +84,6 @@ class IOUVM(BaseVM):
|
|||||||
self._started = False
|
self._started = False
|
||||||
self._path = None
|
self._path = None
|
||||||
self._ioucon_thread = None
|
self._ioucon_thread = None
|
||||||
self._console_host = console_host
|
|
||||||
|
|
||||||
# IOU settings
|
# IOU settings
|
||||||
self._ethernet_adapters = []
|
self._ethernet_adapters = []
|
||||||
@ -660,7 +657,7 @@ class IOUVM(BaseVM):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if not self._ioucon_thread:
|
if not self._ioucon_thread:
|
||||||
telnet_server = "{}:{}".format(self._console_host, self.console)
|
telnet_server = "{}:{}".format(self._manager.port_manager.console_host, self.console)
|
||||||
log.info("Starting ioucon for IOU instance {} to accept Telnet connections on {}".format(self._name, telnet_server))
|
log.info("Starting ioucon for IOU instance {} to accept Telnet connections on {}".format(self._name, telnet_server))
|
||||||
args = argparse.Namespace(appl_id=str(self.application_id), debug=False, escape='^^', telnet_limit=0, telnet_server=telnet_server)
|
args = argparse.Namespace(appl_id=str(self.application_id), debug=False, escape='^^', telnet_limit=0, telnet_server=telnet_server)
|
||||||
self._ioucon_thread_stop_event = threading.Event()
|
self._ioucon_thread_stop_event = threading.Event()
|
||||||
|
@ -52,7 +52,6 @@ class QemuVM(BaseVM):
|
|||||||
:param host: host/address to bind for console and UDP connections
|
:param host: host/address to bind for console and UDP connections
|
||||||
:param qemu_id: QEMU VM instance ID
|
:param qemu_id: QEMU VM instance ID
|
||||||
:param console: TCP console port
|
:param console: TCP console port
|
||||||
:param console_host: IP address to bind for console connections
|
|
||||||
:param monitor: TCP monitor port
|
:param monitor: TCP monitor port
|
||||||
:param monitor_host: IP address to bind for monitor connections
|
:param monitor_host: IP address to bind for monitor connections
|
||||||
"""
|
"""
|
||||||
@ -65,14 +64,12 @@ class QemuVM(BaseVM):
|
|||||||
qemu_path=None,
|
qemu_path=None,
|
||||||
host="127.0.0.1",
|
host="127.0.0.1",
|
||||||
console=None,
|
console=None,
|
||||||
console_host="0.0.0.0",
|
|
||||||
monitor=None,
|
monitor=None,
|
||||||
monitor_host="0.0.0.0"):
|
monitor_host="127.0.0.1"):
|
||||||
|
|
||||||
super().__init__(name, vm_id, project, manager, console=console)
|
super().__init__(name, vm_id, project, manager, console=console)
|
||||||
|
|
||||||
self._host = host
|
self._host = host
|
||||||
self._console_host = console_host
|
|
||||||
self._command = []
|
self._command = []
|
||||||
self._started = False
|
self._started = False
|
||||||
self._process = None
|
self._process = None
|
||||||
@ -81,7 +78,7 @@ class QemuVM(BaseVM):
|
|||||||
self._monitor_host = monitor_host
|
self._monitor_host = monitor_host
|
||||||
|
|
||||||
# QEMU settings
|
# QEMU settings
|
||||||
self.qemu_path = qemu_path
|
self._qemu_path = qemu_path
|
||||||
self._hda_disk_image = ""
|
self._hda_disk_image = ""
|
||||||
self._hdb_disk_image = ""
|
self._hdb_disk_image = ""
|
||||||
self._options = ""
|
self._options = ""
|
||||||
@ -824,7 +821,7 @@ class QemuVM(BaseVM):
|
|||||||
def _serial_options(self):
|
def _serial_options(self):
|
||||||
|
|
||||||
if self._console:
|
if self._console:
|
||||||
return ["-serial", "telnet:{}:{},server,nowait".format(self._console_host, self._console)]
|
return ["-serial", "telnet:{}:{},server,nowait".format(self._manager.port_manager.console_host, self._console)]
|
||||||
else:
|
else:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user