This is still a draft, not ready for commit yet. But feedback is
welcomed.
This series is related to the problem of inefficient import of OVA
files. The needed enhancements of QEMU was 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 first three patches are just preparation. The main work is in patch
four.
There are still some issues that need to be addressed:
1) The obviously missing check whether QEMU installed in the system
supports the feature we need. Do we already have such (or similar)
checks in libguestfs? Should it be compile-time check or runtime
check?
2) Lots of 'tar' invocations that may not be easily understandable.
3) We need a check for sparse files in tar archive. There is a GNU
extension to tar format that allows space-efficient archiving of
sparse files. While the OVF standard does not allow the use of GNU
extensions we probably should not rely on that.
To address points 2) and 3) I see two possible options. We can either
use some OCaml module that understands tar. There is however a risk that
such module won't provide the necessary info to detect 3). The second
option is to use e.g. libarchive and write small set of C functions that
would implement the necessary magic and use those in OCaml code.
Richard, do you have any preferences or suggestions in this matter?
Tomáš Golembiovský (5):
mllib: compute checksum of file inside tar
v2v: ova: don't detect compressed disks, read the OVF instead
v2v: ova: move the untar function
v2v: ova: don't extract files from OVA if it's not needed
v2v: update tests to match changes in OVA import
mllib/checksums.ml | 10 ++-
mllib/checksums.mli | 2 +-
v2v/Makefile.am | 1 +
v2v/input_ova.ml | 144 ++++++++++++++++++++++++++-------
v2v/test-v2v-i-ova-formats.sh | 5 +-
v2v/test-v2v-i-ova-gz.ovf | 2 +-
v2v/test-v2v-i-ova-subfolders.expected | 2 +-
v2v/test-v2v-i-ova-tar.expected | 18 +++++
v2v/test-v2v-i-ova-tar.ovf | 138 +++++++++++++++++++++++++++++++
v2v/test-v2v-i-ova-tar.sh | 64 +++++++++++++++
v2v/test-v2v-i-ova-two-disks.expected | 4 +-
v2v/test-v2v-i-ova-two-disks.sh | 5 +-
12 files changed, 354 insertions(+), 41 deletions(-)
create mode 100644 v2v/test-v2v-i-ova-tar.expected
create mode 100644 v2v/test-v2v-i-ova-tar.ovf
create mode 100755 v2v/test-v2v-i-ova-tar.sh
--
2.10.1