dom0/core: minor netvm switching

Do not fail when setting netvm to none of running VM.
This commit is contained in:
Marek Marczykowski 2012-04-07 01:26:34 +02:00
parent 1e9cad6498
commit 96756fa1fa

View File

@ -385,7 +385,7 @@ class QubesVm(object):
self._set_netvm(new_netvm)
def _set_netvm(self, new_netvm):
if self.is_running() and not new_netvm.is_running():
if self.is_running() and new_netvm is not None and not new_netvm.is_running():
raise QubesException("Cannot dynamically attach to stopped NetVM")
if self.netvm is not None:
self.netvm.connected_vms.pop(self.qid)