Skip to content

Commit

Permalink
template-postprocess: fast path for file-reflink, like file
Browse files Browse the repository at this point in the history
I don't know if any template currently hits this code path, even the
fedora-26-minimal root.img is large enough to be split into multiple
parts. Maybe Arch Linux?

Related to QubesOS/qubes-core-admin#188
  • Loading branch information
rustybird committed Feb 12, 2018
1 parent 7f28676 commit e6466c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions qubesadmin/tools/qvm_template_postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ def import_root_img(vm, source_dir):
# and destination paths are the same
vid = vm.volumes['root'].vid
pool = vm.app.pools[vm.volumes['root'].pool]
if pool.driver == 'file' and root_path == os.path.join(
pool.config['dir_path'], vid + '.img'):
if (pool.driver in ('file', 'file-reflink')
and root_path == os.path.join(pool.config['dir_path'],
vid + '.img')):
vm.log.info('root.img already in place, do not re-import')
return
with open(root_path, 'rb') as root_file:
Expand Down

0 comments on commit e6466c3

Please sign in to comment.