events: improve handling qubesd restart

qubesd may be restarted during different stages of connection - either
while attempting to connect, or while already listening on events.
Adjust exception list accordingly.

This is especially important for qvm-start-gui - otherwise it crashes on
qubesd restart.
This commit is contained in:
Marek Marczykowski-Górecki 2017-06-21 05:03:04 +02:00
parent c07c57bfef
commit ba2057a2c6
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -118,7 +118,8 @@ class EventsDispatcher(object):
while True:
try:
yield from self._listen_for_events(vm)
except ConnectionRefusedError:
except (ConnectionRefusedError, ConnectionResetError,
FileNotFoundError):
pass
if not reconnect:
break