From afb2a65744efc0dfaab34504e4f6b60779b2203b Mon Sep 17 00:00:00 2001 From: Rusty Bird Date: Tue, 28 Jun 2016 13:26:10 +0000 Subject: [PATCH] qfile-daemon-dvm: Move dispVM killing into cleanup function --- dispvm/qfile-daemon-dvm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dispvm/qfile-daemon-dvm b/dispvm/qfile-daemon-dvm index 423500b6..c2ae9898 100755 --- a/dispvm/qfile-daemon-dvm +++ b/dispvm/qfile-daemon-dvm @@ -150,7 +150,7 @@ class QfileDaemonDvm: return self.do_get_dvm() @staticmethod - def remove_disposable_from_qdb(name): + def finish_disposable(name): qvm_collection = QubesVmCollection() qvm_collection.lock_db_for_writing() qvm_collection.load() @@ -158,6 +158,12 @@ class QfileDaemonDvm: if vm is None: qvm_collection.unlock_db() return False + + try: + vm.force_shutdown() + except QubesException: + # VM already destroyed + pass qvm_collection.pop(vm.qid) qvm_collection.save() qvm_collection.unlock_db() @@ -181,11 +187,6 @@ def main(): subprocess.call(['/usr/lib/qubes/qrexec-client', '-d', dispvm.name, user+':exec /usr/lib/qubes/qubes-rpc-multiplexer ' + exec_index + " " + src_vmname]) - try: - dispvm.force_shutdown() - except QubesException: - # VM already destroyed - pass - qfile.remove_disposable_from_qdb(dispvm.name) + qfile.finish_disposable(dispvm.name) main()