From 3472f195193334e755b6cb8102e5298d33a66f68 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Mon, 2 Mar 2015 18:19:11 -0700 Subject: [PATCH] Use console_host from the PortManager. --- gns3server/modules/iou/iou_vm.py | 5 +---- gns3server/modules/qemu/qemu_vm.py | 9 +++------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/gns3server/modules/iou/iou_vm.py b/gns3server/modules/iou/iou_vm.py index ade3aea4..42a7cedc 100644 --- a/gns3server/modules/iou/iou_vm.py +++ b/gns3server/modules/iou/iou_vm.py @@ -58,7 +58,6 @@ class IOUVM(BaseVM): :param project: Project instance :param manager: parent VM Manager :param console: TCP console port - :params console_host: TCP console host IP :params ethernet_adapters: Number of ethernet adapters :params serial_adapters: Number of serial adapters :params ram: Ram MB @@ -69,7 +68,6 @@ class IOUVM(BaseVM): def __init__(self, name, vm_id, project, manager, console=None, - console_host="0.0.0.0", ram=None, nvram=None, ethernet_adapters=None, @@ -86,7 +84,6 @@ class IOUVM(BaseVM): self._started = False self._path = None self._ioucon_thread = None - self._console_host = console_host # IOU settings self._ethernet_adapters = [] @@ -660,7 +657,7 @@ class IOUVM(BaseVM): """ 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)) 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() diff --git a/gns3server/modules/qemu/qemu_vm.py b/gns3server/modules/qemu/qemu_vm.py index d42e23e1..90a45473 100644 --- a/gns3server/modules/qemu/qemu_vm.py +++ b/gns3server/modules/qemu/qemu_vm.py @@ -52,7 +52,6 @@ class QemuVM(BaseVM): :param host: host/address to bind for console and UDP connections :param qemu_id: QEMU VM instance ID :param console: TCP console port - :param console_host: IP address to bind for console connections :param monitor: TCP monitor port :param monitor_host: IP address to bind for monitor connections """ @@ -65,14 +64,12 @@ class QemuVM(BaseVM): qemu_path=None, host="127.0.0.1", console=None, - console_host="0.0.0.0", monitor=None, - monitor_host="0.0.0.0"): + monitor_host="127.0.0.1"): super().__init__(name, vm_id, project, manager, console=console) self._host = host - self._console_host = console_host self._command = [] self._started = False self._process = None @@ -81,7 +78,7 @@ class QemuVM(BaseVM): self._monitor_host = monitor_host # QEMU settings - self.qemu_path = qemu_path + self._qemu_path = qemu_path self._hda_disk_image = "" self._hdb_disk_image = "" self._options = "" @@ -824,7 +821,7 @@ class QemuVM(BaseVM): def _serial_options(self): 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: return []