diff options
author | Cole Robinson <crobinso@redhat.com> | 2022-01-20 13:31:57 -0500 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2022-01-20 16:34:59 -0500 |
commit | 2815b7406ef89c5f0ce0ad662bedee280d5dd5f1 (patch) | |
tree | e0369a0356b267ecab29ffbd1a171ace17f559c7 | |
parent | 5622854d8ca97d8b7f8c556107f32c19a2d06973 (diff) | |
download | virt-manager-2815b7406ef89c5f0ce0ad662bedee280d5dd5f1.tar.gz |
gfxdetails: Fix switching from listen=none to listen=address
... with the 'hypervisor default' address. In this case, we need to
force set port=-1 in the XML, to make the changes actually stick
Signed-off-by: Cole Robinson <crobinso@redhat.com>
-rw-r--r-- | virtManager/device/gfxdetails.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/virtManager/device/gfxdetails.py b/virtManager/device/gfxdetails.py index 51b4544a..8d460dc9 100644 --- a/virtManager/device/gfxdetails.py +++ b/virtManager/device/gfxdetails.py @@ -268,16 +268,25 @@ class vmmGraphicsDetails(vmmGObjectUI): if not self.widget("graphics-password-chk").get_active(): passwd = None + portauto = self.widget("graphics-port-auto").get_active() port = uiutil.spin_get_helper(self.widget("graphics-port")) - if self.widget("graphics-port-auto").get_active(): + + if (self.widget("graphics-port-auto").get_inconsistent() and + self.widget("graphics-port-auto").is_visible()): + # When switching from listen=None to listen=address with + # Hypervisor default, we need to force autoport otherwise + # the XML change doesn't stick + self._active_edits.append(_EDIT_GFX_PORT) + portauto = True + if portauto: port = -1 listen = uiutil.get_list_selection(self.widget("graphics-listen-type")) addr = uiutil.get_list_selection(self.widget("graphics-address")) - if listen and listen != "none": - listen = addr - else: + if listen and listen == "none": port = None + elif listen: + listen = addr gtype = uiutil.get_list_selection(self.widget("graphics-type")) |