From 173e7e425083f51e122ecb7d602bb565b49e1b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 26 Feb 2018 02:52:27 +0100 Subject: [PATCH] vm: fix calling vm.detach_network() when really needed *oldvalue* argument to property event handler is provided only when the value was not default. Check vm.netvm directly to resolve also default. --- qubes/vm/mix/net.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qubes/vm/mix/net.py b/qubes/vm/mix/net.py index 85d06dd2..0562d131 100644 --- a/qubes/vm/mix/net.py +++ b/qubes/vm/mix/net.py @@ -412,7 +412,8 @@ class NetVMMixin(qubes.events.Emitter): 'Cannot dynamically attach to stopped NetVM: {!r}'.format( newvalue)) - if oldvalue is not None: + # don't check oldvalue, because it's missing if it was default + if self.netvm is not None: if self.is_running(): self.detach_network()