storage: access *_img directly from vm.storage object

Not through vm.something_img proxy.
This commit is contained in:
Marek Marczykowski-Górecki 2016-02-11 05:43:39 +01:00 committed by Wojtek Porczyk
parent c0c0e0022e
commit a73c694f54
2 changed files with 7 additions and 6 deletions

View File

@ -297,7 +297,7 @@ class Storage(object):
# For StandaloneVM create it only if not already exists
# (eg after backup-restore)
if hasattr(self, 'volatile_img') \
and not os.path.exists(self.vm.volatile_img):
and not os.path.exists(self.volatile_img):
self.vm.log.info(
'Creating volatile image: {0}'.format(self.volatile_img))
subprocess.check_call(

View File

@ -72,7 +72,7 @@ class XenStorage(qubes.storage.Storage):
@property
def root_img(self):
'''Path to the root image'''
return self.vm.template.root_img if hasattr(self.vm, 'template') \
return self.vm.template.storage.root_img if hasattr(self.vm, 'template') \
else self.abspath(qubes.config.vm_files['root_img'])
@ -171,8 +171,9 @@ class XenStorage(qubes.storage.Storage):
else:
self.vm.log.info("Copying the template's private image: {}".format(
source_template.private_img))
self._copy_file(source_template.private_img, self.private_img)
source_template.storage.private_img))
self._copy_file(source_template.storage.private_img,
self.private_img)
def create_on_disk_root_img(self, source_template=None):
@ -184,8 +185,8 @@ class XenStorage(qubes.storage.Storage):
elif self.vm.updateable:
# if not updateable, just use template's disk
self.vm.log.info("--> Copying the template's root image: {}".format(
source_template.root_img))
self._copy_file(source_template.root_img, self.root_img)
source_template.storage.root_img))
self._copy_file(source_template.storage.root_img, self.root_img)
def resize_private_img(self, size):