appvm.py 649 B

12345678910111213141516171819202122
  1. #!/usr/bin/python2 -O
  2. # vim: fileencoding=utf-8
  3. import qubes.events
  4. import qubes.vm.qubesvm
  5. class AppVM(qubes.vm.qubesvm.QubesVM):
  6. '''Application VM'''
  7. template = qubes.VMProperty('template', load_stage=4,
  8. vmclass=qubes.vm.templatevm.TemplateVM,
  9. ls_width=31,
  10. doc='Template, on which this AppVM is based.')
  11. def __init__(self, *args, **kwargs):
  12. super(AppVM, self).__init__(*args, **kwargs)
  13. @qubes.events.handler('domain-loaded')
  14. def on_domain_loaded(self, event):
  15. # Some additional checks for template based VM
  16. assert self.template
  17. #self.template.appvms.add(self) # XXX