dispvm: Start required NetVM first (if necessary)

The comment "calling VM have the same netvm" doesn't apply to:
 - DispVM started from dom0 menu
 - DispVM started from a VM with `dispvm_netvm` property modified

Fixes QubesOS/qubes-issues#1334
This commit is contained in:
Marek Marczykowski-Górecki 2015-12-23 19:24:25 +01:00
parent a30e8d1f33
commit d4a42093b1
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -168,8 +168,13 @@ class QubesDisposableVm(QubesVm):
if self.get_power_state() != "Halted": if self.get_power_state() != "Halted":
raise QubesException ("VM is already running!") raise QubesException ("VM is already running!")
# skip netvm state checking - calling VM have the same netvm, so it if self.netvm is not None:
# must be already running if self.netvm.qid != 0:
if not self.netvm.is_running():
if verbose:
print >> sys.stderr, "--> Starting NetVM {0}...".\
format(self.netvm.name)
self.netvm.start(verbose=verbose, **kwargs)
if verbose: if verbose:
print >> sys.stderr, "--> Loading the VM (type = {0})...".format(self.type) print >> sys.stderr, "--> Loading the VM (type = {0})...".format(self.type)