Browse Source

qubes.vm: implement TemplateVM.appvms property

Marek Marczykowski-Górecki 8 years ago
parent
commit
2a46abbefd
1 changed files with 5 additions and 0 deletions
  1. 5 0
      qubes/vm/templatevm.py

+ 5 - 0
qubes/vm/templatevm.py

@@ -15,6 +15,11 @@ class TemplateVM(qubes.vm.qubesvm.QubesVM):
         '''COW image'''
         return self.storage.rootcow_img
 
+    @property
+    def appvms(self):
+        for vm in self.app.domains:
+            if hasattr(vm, 'template') and vm.template is self:
+                yield vm
 
     def __init__(self, *args, **kwargs):
         super(TemplateVM, self).__init__(*args, **kwargs)