core: by default call qrexec services without GUI

Most of them do not need GUI (especially those started from dom0), so
speed the things up a little (no need to wait for guid). But if some
service will need GUI access, there is "gui" parameter.
This commit is contained in:
Marek Marczykowski-Górecki 2015-07-08 01:24:35 +02:00
parent 284419b355
commit e52f0a0566

View File

@ -1552,19 +1552,21 @@ class QubesVm(object):
return retcode
def run_service(self, service, source="dom0", user=None,
passio_popen=False, input=None, localcmd=None):
passio_popen=False, input=None, localcmd=None, gui=False):
if bool(input) + bool(passio_popen) + bool(localcmd) > 1:
raise ValueError("'input', 'passio_popen', 'localcmd' cannot be "
"used together")
if localcmd:
return self.run("QUBESRPC %s %s" % (service, source),
localcmd=localcmd, user=user, wait=True)
localcmd=localcmd, user=user, wait=True, gui=gui)
elif input:
return self.run("QUBESRPC %s %s" % (service, source),
localcmd="echo %s" % input, user=user, wait=True)
localcmd="echo %s" % input, user=user, wait=True,
gui=gui)
else:
return self.run("QUBESRPC %s %s" % (service, source),
passio_popen=passio_popen, user=user, wait=True)
passio_popen=passio_popen, user=user, wait=True,
gui=gui)
def attach_network(self, verbose = False, wait = True, netvm = None):
self.log.debug('attach_network(netvm={!r})'.format(netvm))