cleanup-dispvms 383 B

12345678910111213141516
  1. #!/usr/bin/python
  2. from qubes.qubes import QubesVmCollection
  3. def main():
  4. qvm_collection = QubesVmCollection()
  5. qvm_collection.lock_db_for_writing()
  6. qvm_collection.load()
  7. for vm in qvm_collection.values():
  8. if vm.is_disposablevm() and not vm.is_running():
  9. qvm_collection.pop(vm.qid)
  10. qvm_collection.save()
  11. qvm_collection.unlock_db()
  12. main()