storage: fallback kernels_dir path if there is no 'kernel' volume
Return meaningful value for kernels_dir if VM has no 'kernel' volume. Right now it's mostly useful for tests, but could be also used for new VM classes which doesn't have modules.img, but still use dom0-provided kernel.
This commit is contained in:
parent
723b33a2f6
commit
e110cbecb3
@ -468,8 +468,14 @@ class Storage:
|
||||
If :py:attr:`self.vm.kernel` is :py:obj:`None`, the this points inside
|
||||
:py:attr:`self.vm.dir_path`
|
||||
'''
|
||||
assert 'kernel' in self.vm.volumes, "VM has no kernel volume"
|
||||
if not self.vm.kernel:
|
||||
return None
|
||||
if 'kernel' in self.vm.volumes:
|
||||
return self.vm.volumes['kernel'].kernels_dir
|
||||
return os.path.join(
|
||||
qubes.config.qubes_base_dir,
|
||||
qubes.config.system_path['qubes_kernels_base_dir'],
|
||||
self.vm.kernel)
|
||||
|
||||
def get_disk_utilization(self):
|
||||
''' Returns summed up disk utilization for all domain volumes '''
|
||||
|
Loading…
Reference in New Issue
Block a user