qubes: fix network-related functions

- cleanup_vifs crash when non-networked VM is running
- type error in get_vms_connected_to (store VM objects, not qid)
This commit is contained in:
Marek Marczykowski-Górecki 2016-11-03 00:59:29 +01:00
parent e85b0663f6
commit 28d4feb0d0
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 3 additions and 3 deletions

View File

@ -487,9 +487,9 @@ class VMCollection(object):
for vm in cur_vm.connected_vms:
if vm in dependent_vms:
continue
dependent_vms.add(vm.qid)
dependent_vms.add(vm)
# if vm.is_netvm():
new_vms.add(vm.qid)
new_vms.add(vm)
return dependent_vms

View File

@ -284,7 +284,7 @@ class NetVMMixin(qubes.events.Emitter):
'''
dev_basepath = '/local/domain/%d/device/vif' % self.xid
for dev in self.app.vmm.xs.ls('', dev_basepath):
for dev in self.app.vmm.xs.ls('', dev_basepath) or []:
# check if backend domain is alive
backend_xid = int(self.app.vmm.xs.read('',
'{}/{}/backend-id'.format(dev_basepath, dev)))