v3: Addressed Pino's comments, namely:
- input_ova.ml
- untar takes list of paths
- renamed untar_partial to untar_metadata
- replaced uggly regex with nsplit
- tests
- test changes are part of the main commit
- renamed test-data/guestfs-hashsums.sh to test-data/test-utils.sh
- renamed qemu_version to qemu_is_version and moved it to
test-data/test-utils.sh
- normalize paths in expect files
v2:
- rewritten the tar invocations, the output processing is now done in
OcaML rather than with a shell code; it turned out to be easier and
more readable than I have feared.
- added QEMU version check
- addressed Pino's comments
- changed tests; the expected result is now based on the QEMU used
during testing
This series is related to the problem of inefficient import of OVA
files. The needed enhancements of QEMU were merged into the codebase and
should be available in QEMU 2.8. From there we can use 'size' and
'offset' options in raw driver to tell QEMU to use only subset of a file
as an image.
The patch set is more or less complete. The only outstanding issue is
the missing detection of sparse files inside tar. But this can be done
in a separate patch. As pointed out before I didn't find a way how to
detect that by using the tar tool only and would probably require use of
some external library.
The first three patches are just preparation. The main work is in patch
four. Last patch fixes the tests.
Tomáš Golembiovský (6):
mllib: compute checksum of file inside tar
v2v: ova: don't detect compressed disks, read the OVF instead
v2v: ova: move the untar function
mllib: modify nsplit to take optional noempty and count arguments
tests: rename guestfs-hashsums.sh to test-utils.sh
v2v: ova: don't extract files from OVA if it's not needed
mllib/checksums.ml | 11 +-
mllib/checksums.mli | 7 +-
mllib/common_utils.ml | 12 +-
mllib/common_utils.mli | 12 +-
test-data/Makefile.am | 2 +-
test-data/{guestfs-hashsums.sh => test-utils.sh} | 20 +++
tests/qemu/qemu-liveness.sh | 2 +-
tests/qemu/qemu-snapshot-isolation.sh | 2 +-
v2v/Makefile.am | 1 +
v2v/input_ova.ml | 211 ++++++++++++++++++++---
v2v/test-v2v-i-ova-formats.sh | 7 +-
v2v/test-v2v-i-ova-gz.ovf | 2 +-
v2v/test-v2v-i-ova-gz.sh | 2 +-
v2v/test-v2v-i-ova-subfolders.expected2 | 18 ++
v2v/test-v2v-i-ova-subfolders.sh | 15 +-
v2v/test-v2v-i-ova-tar.expected | 18 ++
v2v/test-v2v-i-ova-tar.expected2 | 18 ++
v2v/test-v2v-i-ova-tar.ovf | 138 +++++++++++++++
v2v/test-v2v-i-ova-tar.sh | 71 ++++++++
v2v/test-v2v-i-ova-two-disks.expected2 | 19 ++
v2v/test-v2v-i-ova-two-disks.sh | 15 +-
v2v/test-v2v-i-ova.sh | 2 +-
v2v/test-v2v-in-place.sh | 2 +-
23 files changed, 553 insertions(+), 54 deletions(-)
rename test-data/{guestfs-hashsums.sh => test-utils.sh} (73%)
create mode 100644 v2v/test-v2v-i-ova-subfolders.expected2
create mode 100644 v2v/test-v2v-i-ova-tar.expected
create mode 100644 v2v/test-v2v-i-ova-tar.expected2
create mode 100644 v2v/test-v2v-i-ova-tar.ovf
create mode 100755 v2v/test-v2v-i-ova-tar.sh
create mode 100644 v2v/test-v2v-i-ova-two-disks.expected2
--
2.10.2