Move vm.appvms to QubesVM
First, TemplateVM is not used anymore (see previous commit). Second, don't harcode on client side that "only TemplateVM can be a template for any VM" (which actually isn't true: AppVM can be a template for DispVM).
This commit is contained in:
parent
edcaed537a
commit
b55f615942
@ -315,6 +315,21 @@ class QubesVM(qubesadmin.base.PropertyHolder):
|
|||||||
e.cmd = command
|
e.cmd = command
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
@property
|
||||||
|
def appvms(self):
|
||||||
|
''' Returns a generator containing all domains based on the current
|
||||||
|
TemplateVM.
|
||||||
|
|
||||||
|
Do not check vm type of self, core (including its extentions) have
|
||||||
|
ultimate control what can be a template of what.
|
||||||
|
'''
|
||||||
|
for vm in self.app.domains:
|
||||||
|
try:
|
||||||
|
if vm.template == self:
|
||||||
|
yield vm
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def klass(self):
|
def klass(self):
|
||||||
''' Qube class '''
|
''' Qube class '''
|
||||||
@ -342,18 +357,8 @@ class StandaloneVM(QubesVM):
|
|||||||
|
|
||||||
class TemplateVM(QubesVM):
|
class TemplateVM(QubesVM):
|
||||||
'''Template for AppVM'''
|
'''Template for AppVM'''
|
||||||
|
pass
|
||||||
|
|
||||||
@property
|
|
||||||
def appvms(self):
|
|
||||||
''' Returns a generator containing all domains based on the current
|
|
||||||
TemplateVM.
|
|
||||||
'''
|
|
||||||
for vm in self.app.domains:
|
|
||||||
try:
|
|
||||||
if vm.template == self:
|
|
||||||
yield vm
|
|
||||||
except AttributeError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
class DispVMWrapper(QubesVM):
|
class DispVMWrapper(QubesVM):
|
||||||
'''Wrapper class for new DispVM, supporting only service call
|
'''Wrapper class for new DispVM, supporting only service call
|
||||||
|
Loading…
Reference in New Issue
Block a user