mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Merge branch '2.2' into 3.0
# Conflicts: # gns3server/compute/base_node.py # gns3server/compute/docker/__init__.py # gns3server/compute/qemu/qemu_vm.py # gns3server/controller/compute.py # gns3server/controller/gns3vm/virtualbox_gns3_vm.py # gns3server/controller/node.py # gns3server/controller/project.py # gns3server/crash_report.py # gns3server/handlers/api/controller/template_handler.py # gns3server/static/web-ui/index.html # gns3server/static/web-ui/main.8448c96e4facbe79a613.js # gns3server/version.py # tests/compute/iou/test_iou_vm.py # tests/compute/qemu/test_qemu_vm.py # tests/handlers/api/controller/test_template.py
This commit is contained in:
commit
1ff23348d3
23 files changed
+763
-138
No files matched your search
@@ -155,7 +155,7 @@ class Docker(BaseManager):
|
||||
)
|
||||
except aiohttp.ClientError as e:
|
||||
raise DockerError(f"Docker has returned an error: {e}")
|
||||
except (asyncio.TimeoutError):
|
||||
except asyncio.TimeoutError:
|
||||
raise DockerError("Docker timeout " + method + " " + path)
|
||||
if response.status >= 300:
|
||||
body = await response.read()
|
||||
|
||||
@@ -107,7 +107,6 @@ class DockerVM(BaseNode):
|
||||
self._ethernet_adapters = []
|
||||
self._temporary_directory = None
|
||||
self._telnet_servers = []
|
||||
self._xvfb_process = None
|
||||
self._vnc_process = None
|
||||
self._vncconfig_process = None
|
||||
self._console_resolution = console_resolution
|
||||
@@ -681,8 +680,8 @@ class DockerVM(BaseNode):
|
||||
self._display = self._get_free_display_port()
|
||||
tigervnc_path = shutil.which("Xtigervnc") or shutil.which("Xvnc")
|
||||
|
||||
if not (tigervnc_path or shutil.which("Xvfb") and shutil.which("x11vnc")):
|
||||
raise DockerError("Please install TigerVNC (recommended) or Xvfb + x11vnc before using VNC support")
|
||||
if not tigervnc_path:
|
||||
raise DockerError("Please install TigerVNC server before using VNC support")
|
||||
|
||||
if tigervnc_path:
|
||||
with open(os.path.join(self.working_dir, "vnc.log"), "w") as fd:
|
||||
@@ -696,29 +695,6 @@ class DockerVM(BaseNode):
|
||||
"-SecurityTypes", "None",
|
||||
":{}".format(self._display),
|
||||
stdout=fd, stderr=subprocess.STDOUT)
|
||||
else:
|
||||
if restart is False:
|
||||
self._xvfb_process = await asyncio.create_subprocess_exec("Xvfb",
|
||||
"-nolisten", "tcp",
|
||||
"-extension", "MIT-SHM",
|
||||
":{}".format(self._display),
|
||||
"-screen", "0",
|
||||
self._console_resolution + "x16")
|
||||
|
||||
# We pass a port for TCPV6 due to a crash in X11VNC if not here: https://github.com/GNS3/gns3-server/issues/569
|
||||
with open(os.path.join(self.working_dir, "vnc.log"), "w") as fd:
|
||||
self._vnc_process = await asyncio.create_subprocess_exec("x11vnc",
|
||||
"-forever",
|
||||
"-nopw",
|
||||
"-shared",
|
||||
"-noshm",
|
||||
"-geometry", self._console_resolution,
|
||||
"-display", "WAIT:{}".format(self._display),
|
||||
"-rfbport", str(self.console),
|
||||
"-rfbportv6", str(self.console),
|
||||
"-noncache",
|
||||
"-listen", self._manager.port_manager.console_host,
|
||||
stdout=fd, stderr=subprocess.STDOUT)
|
||||
|
||||
async def _start_vnc(self):
|
||||
"""
|
||||
@@ -727,8 +703,8 @@ class DockerVM(BaseNode):
|
||||
|
||||
self._display = self._get_free_display_port()
|
||||
tigervnc_path = shutil.which("Xtigervnc") or shutil.which("Xvnc")
|
||||
if not (tigervnc_path or shutil.which("Xvfb") and shutil.which("x11vnc")):
|
||||
raise DockerError("Please install TigerVNC server (recommended) or Xvfb + x11vnc before using VNC support")
|
||||
if not tigervnc_path:
|
||||
raise DockerError("Please install TigerVNC server before using VNC support")
|
||||
await self._start_vnc_process()
|
||||
x11_socket = os.path.join("/tmp/.X11-unix/", f"X{self._display}")
|
||||
try:
|
||||
@@ -1002,12 +978,6 @@ class DockerVM(BaseNode):
|
||||
await self._vnc_process.wait()
|
||||
except ProcessLookupError:
|
||||
pass
|
||||
if self._xvfb_process:
|
||||
try:
|
||||
self._xvfb_process.terminate()
|
||||
await self._xvfb_process.wait()
|
||||
except ProcessLookupError:
|
||||
pass
|
||||
|
||||
if self._display:
|
||||
display = f"/tmp/.X11-unix/X{self._display}"
|
||||
|
||||
@@ -2374,6 +2374,8 @@ class QemuVM(BaseNode):
|
||||
mac = int_to_macaddress(macaddress_to_int(custom_mac_address))
|
||||
|
||||
device_string = f"{adapter_type},mac={mac}"
|
||||
if adapter_type == "virtio-net-pci":
|
||||
device_string = "{},speed=10000,duplex=full".format(device_string)
|
||||
bridge_id = math.floor(pci_device_id / 32)
|
||||
if bridge_id > 0:
|
||||
if pci_bridges_created < bridge_id:
|
||||
|
||||
Reference in new issue
Block a user