Skip to content

Commit

Permalink
storage/kernels: support only save_on_stop=False volumes
Browse files Browse the repository at this point in the history
LinuxKernel pool support only read-only volumes, so save_on_stop=True
doesn't make sense. Make it more explicit - raise NotImplementedError
otherwise.
Also, migrate old configs where snap_on_start=True, but no source was
given.

QubesOS/qubes-issues#2256
  • Loading branch information
marmarek committed Jul 4, 2017
1 parent 0e55429 commit c7ca4a4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions qubes/storage/kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ def __init__(self, name=None, dir_path=None):
def init_volume(self, vm, volume_config):
assert not volume_config['rw']

# migrate old config
if volume_config.get('snap_on_start', False) and not \
volume_config.get('source', None):
volume_config['snap_on_start'] = False

if volume_config.get('save_on_stop', False):
raise NotImplementedError(
'LinuxKernel pool does not support save_on_stop=True')
volume_config['pool'] = self
volume = LinuxModules(self.dir_path, lambda: vm.kernel, **volume_config)

Expand Down

0 comments on commit c7ca4a4

Please sign in to comment.