storage/file: simplify search for origin volume of snapshot/read-only
Check directly vm.template, throwing AttributeError when not found. There may be some value in converting it to more descriptive error, but since that's mostly for internal users (not user facing actions) don't bother for now. QubesOS/qubes-issues#1842
This commit is contained in:
والد
07b72ef3fd
کامیت
b119b2c36b
@ -239,10 +239,8 @@ class FilePool(Pool):
|
||||
if volume_type in ['snapshot', 'read-only']:
|
||||
name = volume_config['name']
|
||||
|
||||
origin_vm = vm
|
||||
while hasattr(origin_vm, 'template') and \
|
||||
origin_vm.volume_config[name]['volume_type'] == \
|
||||
volume_type:
|
||||
origin_vm = vm.template
|
||||
while origin_vm.volume_config[name]['volume_type'] == volume_type:
|
||||
origin_vm = origin_vm.template
|
||||
|
||||
expected_origin_type = {
|
||||
|
بارگذاری…
مرجع در شماره جدید
Block a user