From e6466c3783b985f7ee6d6aef57936f9b780559bf Mon Sep 17 00:00:00 2001 From: Rusty Bird Date: Mon, 12 Feb 2018 21:51:01 +0000 Subject: [PATCH] template-postprocess: fast path for file-reflink, like file 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 https://github.com/QubesOS/qubes-core-admin/pull/188 --- qubesadmin/tools/qvm_template_postprocess.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qubesadmin/tools/qvm_template_postprocess.py b/qubesadmin/tools/qvm_template_postprocess.py index ccfce888..9f6eb036 100644 --- a/qubesadmin/tools/qvm_template_postprocess.py +++ b/qubesadmin/tools/qvm_template_postprocess.py @@ -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: