From b964e8c33fd2a23e972022bb042fc72d006f30c2 Mon Sep 17 00:00:00 2001 From: Rusty Bird Date: Tue, 28 Jun 2016 13:36:16 +0000 Subject: [PATCH] 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. --- dispvm/qfile-daemon-dvm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dispvm/qfile-daemon-dvm b/dispvm/qfile-daemon-dvm index c79e82e1..209e2228 100755 --- a/dispvm/qfile-daemon-dvm +++ b/dispvm/qfile-daemon-dvm @@ -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 ' +