vm/mix/net: fill QubesDB for already connected VMs

There may be cases when VM providing the network to other VMs is started
later - for example VM restart. While this is rare case (and currently
broken because of QubesOS/qubes-issues#1426), do not assume it will
always be the case.
This commit is contained in:
Marek Marczykowski-Górecki 2017-12-14 02:10:11 +01:00
parent 1187e43697
commit 297cb4d012
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -443,9 +443,13 @@ class NetVMMixin(qubes.events.Emitter):
@qubes.events.handler('domain-qdb-create') @qubes.events.handler('domain-qdb-create')
def on_domain_qdb_create(self, event): def on_domain_qdb_create(self, event):
''' Fills the QubesDB with firewall entries. Not implemented ''' ''' Fills the QubesDB with firewall entries. '''
# SEE: 1815 fill firewall QubesDB entries # pylint: disable=unused-argument
pass for vm in self.connected_vms:
if vm.is_running():
# keep in sync with on_firewall_changed
self.set_mapped_ip_info_for_vm(vm)
self.reload_firewall_for_vm(vm)
@qubes.events.handler('firewall-changed', 'domain-spawn') @qubes.events.handler('firewall-changed', 'domain-spawn')
def on_firewall_changed(self, event, **kwargs): def on_firewall_changed(self, event, **kwargs):