From 926596cba78d0d4faa8ffea73e5a16ee22c73bd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 8 Feb 2016 20:27:44 +0100 Subject: [PATCH] Initialize vm.storage after loading all the properties It needs at least vm.name to be set. --- qubes/vm/qubesvm.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index 4c212079..0347b188 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -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):