dom0/core: disable automatic starting NetVM when trying attach to

This commit is contained in:
Marek Marczykowski 2012-03-10 21:03:15 +01:00
parent 24d521c1b3
commit dd89fab841

View File

@ -375,6 +375,8 @@ class QubesVm(object):
self._set_netvm(new_netvm)
def _set_netvm(self, new_netvm):
if self.is_running() 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)
if self.is_running():
@ -398,8 +400,6 @@ class QubesVm(object):
return
if self.is_running():
if not new_netvm.is_running():
new_netvm.start()
# refresh IP, DNS etc
self.create_xenstore_entries()
self.attach_network()