vm: init vm.storage and vm.volumes in BaseVM
This way also AdminVM will have (empty) properties there. It is much cleaner than adding `if hasattr` or catching AttributeError everywhere.
This commit is contained in:
parent
160ab964bc
commit
5209bc370d
@ -283,6 +283,12 @@ class BaseVM(qubes.PropertyHolder):
|
||||
#: logger instance for logging messages related to this VM
|
||||
self.log = None
|
||||
|
||||
#: storage volumes
|
||||
self.volumes = {}
|
||||
|
||||
#: storage manager
|
||||
self.storage = None
|
||||
|
||||
if hasattr(self, 'name'):
|
||||
self.init_log()
|
||||
|
||||
|
@ -631,8 +631,6 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
||||
|
||||
def __init__(self, app, xml, volume_config=None, **kwargs):
|
||||
super(QubesVM, self).__init__(app, xml, **kwargs)
|
||||
self.volumes = {}
|
||||
self.storage = None
|
||||
|
||||
if volume_config is None:
|
||||
volume_config = {}
|
||||
|
Loading…
Reference in New Issue
Block a user