From e1dab0dff4ab1ef1a73003c405b56ae7108cdd3a Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 9 Jun 2020 15:06:41 +0930 Subject: [PATCH] Show error message if IPv6 is not enabled when using SPICE console. Fixes #1772 --- gns3server/compute/qemu/qemu_vm.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gns3server/compute/qemu/qemu_vm.py b/gns3server/compute/qemu/qemu_vm.py index 0e7387e5..191ae4d8 100644 --- a/gns3server/compute/qemu/qemu_vm.py +++ b/gns3server/compute/qemu/qemu_vm.py @@ -1540,11 +1540,14 @@ class QemuVM(BaseNode): if self._console: console_host = self._manager.port_manager.console_host - if console_host == "0.0.0.0" and socket.has_ipv6: - # to fix an issue with Qemu when IPv4 is not enabled - # see https://github.com/GNS3/gns3-gui/issues/2352 - # FIXME: consider making this more global (not just for Qemu + SPICE) - console_host = "::" + if console_host == "0.0.0.0": + if socket.has_ipv6: + # to fix an issue with Qemu when IPv4 is not enabled + # see https://github.com/GNS3/gns3-gui/issues/2352 + # FIXME: consider making this more global (not just for Qemu + SPICE) + console_host = "::" + else: + raise QemuError("IPv6 must be enabled in order to use the SPICE console") return ["-spice", "addr={},port={},disable-ticketing".format(console_host, self._console), "-vga", "qxl"]