core/hvm: handle verbose option for guid

This commit is contained in:
Marek Marczykowski-Górecki 2015-02-09 05:39:44 +01:00
parent 5d9fa977e2
commit 2def43517a
2 changed files with 18 additions and 12 deletions

View File

@ -1537,7 +1537,7 @@ class QubesVm(object):
p.communicate(input=self.default_user) p.communicate(input=self.default_user)
def start_guid(self, verbose = True, notify_function = None, def start_guid(self, verbose = True, notify_function = None,
extra_guid_args=[], before_qrexec=False): extra_guid_args=None, before_qrexec=False):
if verbose: if verbose:
print >> sys.stderr, "--> Starting Qubes GUId..." print >> sys.stderr, "--> Starting Qubes GUId..."
@ -1546,6 +1546,7 @@ class QubesVm(object):
"-c", self.label.color, "-c", self.label.color,
"-i", self.label.icon_path, "-i", self.label.icon_path,
"-l", str(self.label.index)] "-l", str(self.label.index)]
if extra_guid_args is not None:
guid_cmd += extra_guid_args guid_cmd += extra_guid_args
if self.debug: if self.debug:
guid_cmd += ['-v', '-v'] guid_cmd += ['-v', '-v']

View File

@ -380,15 +380,20 @@ class QubesHVm(QubesVm):
else: else:
raise raise
def start_stubdom_guid(self): def start_stubdom_guid(self, verbose=True):
cmdline = [system_path["qubes_guid_path"],
guid_cmd = [system_path["qubes_guid_path"],
"-d", str(self.stubdom_xid), "-d", str(self.stubdom_xid),
"-t", str(self.xid), "-t", str(self.xid),
"-N", self.name, "-N", self.name,
"-c", self.label.color, "-c", self.label.color,
"-i", self.label.icon_path, "-i", self.label.icon_path,
"-l", str(self.label.index)] "-l", str(self.label.index)]
retcode = subprocess.call (cmdline) if self.debug:
guid_cmd += ['-v', '-v']
elif not verbose:
guid_cmd += ['-q']
retcode = subprocess.call (guid_cmd)
if (retcode != 0) : if (retcode != 0) :
raise QubesException("Cannot start qubes-guid!") raise QubesException("Cannot start qubes-guid!")
@ -407,7 +412,7 @@ class QubesHVm(QubesVm):
elif before_qrexec and (not self.guiagent_installed or self.debug): elif before_qrexec and (not self.guiagent_installed or self.debug):
if verbose: if verbose:
print >> sys.stderr, "--> Starting Qubes GUId (full screen)..." print >> sys.stderr, "--> Starting Qubes GUId (full screen)..."
self.start_stubdom_guid() self.start_stubdom_guid(verbose=verbose)
def start_qrexec_daemon(self, **kwargs): def start_qrexec_daemon(self, **kwargs):
if not self.qrexec_installed: if not self.qrexec_installed: