qubes/vm: initialize vm.volumes in one place
Move it to QubesVM, instead of each class separately.
This commit is contained in:
parent
28591fa6be
commit
36644f3710
@ -16,7 +16,6 @@ class AppVM(qubes.vm.qubesvm.QubesVM):
|
|||||||
doc='Template, on which this AppVM is based.')
|
doc='Template, on which this AppVM is based.')
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.volumes = {}
|
|
||||||
self.volume_config = {
|
self.volume_config = {
|
||||||
'root': {
|
'root': {
|
||||||
'name': 'root',
|
'name': 'root',
|
||||||
|
@ -20,7 +20,6 @@ class DispVM(qubes.vm.qubesvm.QubesVM):
|
|||||||
doc='''Internal, persistent identifier of particular DispVM.''')
|
doc='''Internal, persistent identifier of particular DispVM.''')
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.volumes = {}
|
|
||||||
self.volume_config = {
|
self.volume_config = {
|
||||||
'root': {
|
'root': {
|
||||||
'name': 'root',
|
'name': 'root',
|
||||||
|
@ -434,6 +434,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
|
|
||||||
def __init__(self, app, xml, volume_config={}, **kwargs):
|
def __init__(self, app, xml, volume_config={}, **kwargs):
|
||||||
super(QubesVM, self).__init__(app, xml, **kwargs)
|
super(QubesVM, self).__init__(app, xml, **kwargs)
|
||||||
|
self.volumes = {}
|
||||||
if hasattr(self, 'volume_config'):
|
if hasattr(self, 'volume_config'):
|
||||||
if xml is not None:
|
if xml is not None:
|
||||||
for node in xml.xpath('volume-config/volume'):
|
for node in xml.xpath('volume-config/volume'):
|
||||||
|
@ -30,7 +30,6 @@ class TemplateVM(QubesVM):
|
|||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
assert 'template' not in kwargs, "A TemplateVM can not have a template"
|
assert 'template' not in kwargs, "A TemplateVM can not have a template"
|
||||||
self.volumes = {}
|
|
||||||
self.volume_config = {
|
self.volume_config = {
|
||||||
'root': {
|
'root': {
|
||||||
'name': 'root',
|
'name': 'root',
|
||||||
|
Loading…
Reference in New Issue
Block a user