1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-15 12:59:06 +00:00

Bind UDP tunnels to the correct source address. Fixes #96.

This commit is contained in:
Jeremy 2015-03-16 12:45:21 -06:00
parent bcb1ce02ab
commit cc9b575b77
2 changed files with 6 additions and 12 deletions

View File

@ -15,9 +15,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
from ...web.route import Route from ...web.route import Route
from ...schemas.qemu import QEMU_CREATE_SCHEMA from ...schemas.qemu import QEMU_CREATE_SCHEMA
from ...schemas.qemu import QEMU_UPDATE_SCHEMA from ...schemas.qemu import QEMU_UPDATE_SCHEMA
@ -55,8 +52,8 @@ class QEMUHandler:
request.json.get("vm_id"), request.json.get("vm_id"),
qemu_path=request.json.get("qemu_path"), qemu_path=request.json.get("qemu_path"),
console=request.json.get("console"), console=request.json.get("console"),
monitor=request.json.get("monitor"), monitor=request.json.get("monitor"))
)
# Clear already used keys # Clear already used keys
map(request.json.__delitem__, ["name", "project_id", "vm_id", map(request.json.__delitem__, ["name", "project_id", "vm_id",
"qemu_path", "console", "monitor"]) "qemu_path", "console", "monitor"])

View File

@ -49,11 +49,9 @@ class QemuVM(BaseVM):
:param manager: parent VM Manager :param manager: parent VM Manager
:param console: TCP console port :param console: TCP console port
:param qemu_path: path to the QEMU binary :param qemu_path: path to the QEMU binary
: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 monitor: TCP monitor port :param monitor: TCP monitor port
:param monitor_host: IP address to bind for monitor connections
""" """
def __init__(self, def __init__(self,
@ -62,20 +60,19 @@ class QemuVM(BaseVM):
project, project,
manager, manager,
qemu_path=None, qemu_path=None,
host="127.0.0.1",
console=None, console=None,
monitor=None, monitor=None):
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 server_config = manager.config.get_section_config("Server")
self._host = server_config.get("host", "127.0.0.1")
self._monitor_host = server_config.get("monitor_host", "127.0.0.1")
self._command = [] self._command = []
self._started = False self._started = False
self._process = None self._process = None
self._cpulimit_process = None self._cpulimit_process = None
self._stdout_file = "" self._stdout_file = ""
self._monitor_host = monitor_host
# QEMU settings # QEMU settings
self._qemu_path = qemu_path self._qemu_path = qemu_path