events: ignore events from non-existing domains
It may happen that when client handle the event, domain no longer exists. This is for example common for DispVMs, which get removed just after shutdown. This will cause some events to be dropped, but one can enable blind mode, to get them anyway (because it will not cause KeyError, even if domain is already removed). QubesOS/qubes-issues#3100
This commit is contained in:
parent
b28ddb6621
commit
0a06ad9152
@ -191,7 +191,10 @@ class EventsDispatcher(object):
|
|||||||
if subject:
|
if subject:
|
||||||
if event in ['property-set:name']:
|
if event in ['property-set:name']:
|
||||||
self.app.domains.clear_cache()
|
self.app.domains.clear_cache()
|
||||||
|
try:
|
||||||
subject = self.app.domains[subject]
|
subject = self.app.domains[subject]
|
||||||
|
except KeyError:
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
# handle cache refreshing on best-effort basis
|
# handle cache refreshing on best-effort basis
|
||||||
if event in ['domain-add', 'domain-delete']:
|
if event in ['domain-add', 'domain-delete']:
|
||||||
|
Loading…
Reference in New Issue
Block a user