Browse Source

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.
Rusty Bird 8 years ago
parent
commit
b964e8c33f
1 changed files with 8 additions and 0 deletions
  1. 8 0
      dispvm/qfile-daemon-dvm

+ 8 - 0
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 ' +