mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-03-08 04:58:29 +03:00
graphics: set default port only for correct listen types
The default port and tlsPort should be configured only if no listen type was specified or the listen type is "address" or "network". For other listen types the port and tlsPort doesn't make sense. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
f14b1f88a0
commit
ccaef8c16a
@ -234,7 +234,7 @@
|
||||
<mouse mode="client"/>
|
||||
<filetransfer enable="yes"/>
|
||||
</graphics>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<graphics type="spice">
|
||||
<gl enable="yes"/>
|
||||
<image compression="off"/>
|
||||
<listen type="socket"/>
|
||||
|
@ -144,12 +144,15 @@ class VirtualGraphics(VirtualDevice):
|
||||
val = _validate_port("TLS Port", val)
|
||||
self.autoport = self._get_default_autoport()
|
||||
return val
|
||||
def _listen_need_port(self):
|
||||
listen = self.get_first_listen_type()
|
||||
return not listen or listen in ["address", "network"]
|
||||
def _get_default_port(self):
|
||||
if self.type == "vnc" or self.type == "spice":
|
||||
if (self.type == "vnc" or self.type == "spice") and self._listen_need_port():
|
||||
return -1
|
||||
return None
|
||||
def _get_default_tlsport(self):
|
||||
if self.type == "spice":
|
||||
if self.type == "spice" and self._listen_need_port():
|
||||
return -1
|
||||
return None
|
||||
def _get_default_autoport(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user