Initialize vm.storage after loading all the properties

It needs at least vm.name to be set.
This commit is contained in:
Marek Marczykowski-Górecki 2016-02-08 20:27:44 +01:00 committed by Wojtek Porczyk
parent 3af71ab65d
commit 926596cba7

View File

@ -456,9 +456,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
if not self.app.check_updates_vm:
self.services['qubes-update-check'] = False
# Initialize VM image storage class
self.storage = qubes.storage.get_pool(
self.pool_name, self).get_storage(self)
# will be initialized after loading all the properties
self.storage = None
# fire hooks
if xml is None:
@ -476,6 +475,10 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
if not hasattr(self, 'uuid'):
self.uuid = uuid.uuid4()
# Initialize VM image storage class
self.storage = qubes.storage.get_pool(
self.pool_name, self).get_storage()
@qubes.events.handler('property-set:label')
def on_property_set_label(self, event, name, new_label, old_label=None):