virt-manager: if new --connect fails, don't save the URI

This commit is contained in:
Cole Robinson 2018-03-16 17:33:06 -04:00
parent 6969066b9f
commit ad632383c8
1 changed files with 4 additions and 0 deletions

View File

@ -515,6 +515,7 @@ class vmmEngine(vmmGObject):
self._get_manager().show() self._get_manager().show()
return return
conn_is_new = uri not in self._connobjs
conn = vmmConnectionManager.get_instance().add_conn(uri) conn = vmmConnectionManager.get_instance().add_conn(uri)
if conn.is_active(): if conn.is_active():
self.idle_add(self._launch_cli_window, self.idle_add(self._launch_cli_window,
@ -523,6 +524,9 @@ class vmmEngine(vmmGObject):
def _open_completed(_c, ConnectError): def _open_completed(_c, ConnectError):
if ConnectError: if ConnectError:
if conn_is_new:
logging.debug("Removing failed uri=%s", uri)
vmmConnectionManager.get_instance().remove_conn(uri)
self._handle_conn_error(conn, ConnectError) self._handle_conn_error(conn, ConnectError)
else: else:
self._launch_cli_window(uri, show_window, domain) self._launch_cli_window(uri, show_window, domain)