vm/dispvm: fix DispVM storage definition

Specify empty 'source' field, so it gets filled with appropriate
template's images. Then also fix recursive 'source' handling - DispVM
root volume should point at TemplateVM's root volume as a source, not a
AppVM's one - which is also only a snapshot.

Fixes QubesOS/qubes-issues#2896
This commit is contained in:
Marek Marczykowski-Górecki 2017-07-08 02:36:39 +02:00
parent d9db4f747c
commit 148d1cda78
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 7 additions and 1 deletions

View File

@ -351,7 +351,7 @@ class Storage(object):
for name, conf in self.vm.volume_config.items():
if 'source' in conf:
template = getattr(vm, 'template', None)
if template:
while template:
# we have no control over VM load order,
# so initialize storage recursively if needed
if template.storage is None:
@ -360,6 +360,10 @@ class Storage(object):
# maybe we don't need it at all if it's always from
# VM's template?
conf['source'] = template.volumes[name]
if conf['source'].source is not None:
template = getattr(template, 'template', None)
else:
break
self.init_volume(name, conf)

View File

@ -47,6 +47,7 @@ class DispVM(qubes.vm.qubesvm.QubesVM):
'snap_on_start': True,
'save_on_stop': False,
'rw': False,
'source': None,
},
'private': {
'name': 'private',
@ -54,6 +55,7 @@ class DispVM(qubes.vm.qubesvm.QubesVM):
'snap_on_start': True,
'save_on_stop': False,
'rw': True,
'source': None,
},
'volatile': {
'name': 'volatile',