core-admin/linux/aux-tools/cleanup-dispvms
2013-03-16 19:56:51 +01:00

17 lines
383 B
Python
Executable File

#!/usr/bin/python
from qubes.qubes import QubesVmCollection
def main():
qvm_collection = QubesVmCollection()
qvm_collection.lock_db_for_writing()
qvm_collection.load()
for vm in qvm_collection.values():
if vm.is_disposablevm() and not vm.is_running():
qvm_collection.pop(vm.qid)
qvm_collection.save()
qvm_collection.unlock_db()
main()