import/export: drop the 'subvol/' prefix from 'tar+size'

It was deemed an unnecessary overhead.

Also add a comment about the effect (or lack thereof) of
user namespace uid mappings.
This commit is contained in:
Wolfgang Bumiller
2017-06-22 14:21:52 +02:00
committed by Dietmar Maurer
parent 030f6e1a97
commit 6b3a4a2504

View File

@ -916,8 +916,11 @@ sub check_connection {
# files which are already in qcow2 format, or via `qemu-img convert`.
# Note that these formats are only valid with $with_snapshots being true.
# tar+size: (subvolumes only)
# A GNU tar stream with the inner contents of the subvolume put into the
# 'subvol/' directory.
# A GNU tar stream containing just the inner contents of the subvolume.
# This does not distinguish between the contents of a privileged or
# unprivileged container. In other words, this is from the root user
# namespace's point of view with no uid-mapping in effect.
# As produced via `tar -C vm-100-disk-1.subvol -cpf TheOutputFile.dat .`
# Plugins may reuse these helpers. Changes to the header format should be
# reflected by changes to the function prototypes.
@ -962,7 +965,7 @@ sub volume_export {
} elsif ($format eq 'tar+size') {
goto unsupported if $file_format ne 'subvol';
write_common_header($fh, $size);
run_command(['tar', @COMMON_TAR_FLAGS, '--xform=s,^\./,subvol/,S', '-cf', '-', '-C', $file, '.'],
run_command(['tar', @COMMON_TAR_FLAGS, '-cf', '-', '-C', $file, '.'],
output => '>&'.fileno($fh));
return;
}
@ -1030,7 +1033,7 @@ sub volume_import {
run_command(['dd', "of=$file", 'conv=sparse', 'bs=64k'],
input => '<&'.fileno($fh));
} elsif ($data_format eq 'tar') {
run_command(['tar', @COMMON_TAR_FLAGS, '-C', $file, '--xform=s,^subvol/,./,S', '-xf', '-'],
run_command(['tar', @COMMON_TAR_FLAGS, '-C', $file, '-xf', '-'],
input => '<&'.fileno($fh));
} else {
die "volume import format '$format' not available for $class";