]> git.ipfire.org Git - thirdparty/systemd.git/commit
nspawn: add fallback top normal copy/reflink when we cannot btrfs snapshot
authorLennart Poettering <lennart@poettering.net>
Mon, 21 Nov 2016 19:02:43 +0000 (20:02 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 22 Nov 2016 12:35:09 +0000 (13:35 +0100)
commit17cbb288faa4a5c900d54a5de53f804116d897df
treedd84aa1ac01b5b0b67a04cb910e7e103062b0d27
parentc67b008273478dd54a57c0950a0c69b2b544c85b
nspawn: add fallback top normal copy/reflink when we cannot btrfs snapshot

Given that other file systems (notably: xfs) support reflinks these days, let's
extend the file system snapshotting logic to fall back to plan copies or
reflinks when full btrfs subvolume snapshots are not available.

This essentially makes "systemd-nspawn --ephemeral" and "systemd-nspawn
--template=" available on non-btrfs subvolumes. Of course, both operations will
still be slower on non-btrfs than on btrfs (simply because reflinking each file
individually in a directory tree is still slower than doing this in one step
for a whole subvolume), but it's probably good enough for many cases, and we
should provide the users with the tools, they have to figure out what's good
for them.

Note that "machinectl clone" already had a fallback like this in place, this
patch generalizes this, and adds similar support to our other cases.
man/machinectl.xml
man/systemd-nspawn.xml
src/basic/btrfs-util.c
src/basic/btrfs-util.h
src/import/pull-common.c
src/nspawn/nspawn.c
src/shared/machine-image.c