From 28d4feb0d0f8b63811b0b8427b717de5bc7a2bd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 3 Nov 2016 00:59:29 +0100 Subject: [PATCH] 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) --- qubes/app.py | 4 ++-- qubes/vm/mix/net.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qubes/app.py b/qubes/app.py index eb28165c..f56cb2a8 100644 --- a/qubes/app.py +++ b/qubes/app.py @@ -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 diff --git a/qubes/vm/mix/net.py b/qubes/vm/mix/net.py index b8f851d1..e7227faf 100644 --- a/qubes/vm/mix/net.py +++ b/qubes/vm/mix/net.py @@ -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)))