qfile-daemon-dvm: Implement LAUNCH and FINISH actions

If the action is LAUNCH instead of qubes.SomeService, then just start
the dispVM, write (only) its name to stdout, and quit.

If the action is FINISH, then kill and remove the named dispVM.
This commit is contained in:
Rusty Bird 2016-06-28 13:36:16 +00:00
parent 142cb9e240
commit b964e8c33f
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF

View File

@ -171,6 +171,10 @@ class QfileDaemonDvm:
def main():
exec_index = sys.argv[1]
if exec_index == "FINISH":
QfileDaemonDvm.finish_disposable(sys.argv[2])
return
src_vmname = sys.argv[2]
user = sys.argv[3]
# accessed directly by get_dvm()
@ -183,6 +187,10 @@ def main():
qfile = QfileDaemonDvm(src_vmname)
dispvm = qfile.get_dvm()
if dispvm is not None:
if exec_index == "LAUNCH":
print dispvm.name
return
print >>sys.stderr, "time=%s, starting VM process" % (str(time.time()))
subprocess.call(['/usr/lib/qubes/qrexec-client', '-d', dispvm.name,
user+':exec /usr/lib/qubes/qubes-rpc-multiplexer ' +