dom0/core: add missing "cleanup_dispvms" file (#648)
This commit is contained in:
parent
e1404a2d4f
commit
4f56cf420a
16
dom0/aux-tools/cleanup_dispvms
Executable file
16
dom0/aux-tools/cleanup_dispvms
Executable file
@ -0,0 +1,16 @@
|
||||
#!/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()
|
Loading…
Reference in New Issue
Block a user