+ qemu-img convert -f qcow2 snapshot.qcow2 -O raw local.img
+
+Which is faster?
+
+Benchmark B results
+----------------------------------------------------------------------
+
+(Same as above, with results)
+
+The results are interesting, but if you remember what we said about
+the disk format and sparsification then it shouldn't be surprising.
+
+The copy and tar commands have to churn through the entire
+disk image - zeroes and deleted files.
+
+With nbdkit, sparsification and qemu-img convert we only copy a
+fraction of the data.
+
+Note the two methods do NOT produce bit-for-bit equivalent outputs.
+Q: Is this a problem?
+A: No different from if the owner of the VM had run "fstrim".
+
+
+Modifications
+----------------------------------------------------------------------
+
+Virt-v2v doesn't only make efficient copies, it also modifies the disk
+image in flight. Some kinds of modifications that are made:
+
+ - installing virtio drivers
+
+ - removing VMware tools
+
+ - modifying the bootloader
+
+ - rebuilding initramfs
+
+ - changing device names in /etc files
+
+ - changing the Windows registry
+
+ - (and much more)
+
+These are significant modifications, and they happen entirely during
+the transfer, without touching the source and without making large
+temporary copies.
+
+I'm not going to talk about this in great detail because it's a very
+complex topic. Instead I will show you a simple demonstration of a
+similar technique.
+
+DIAGRAM:
+
+ (Screenshot from https://alt.fedoraproject.org/cloud/)
+
+ HTTPS
+ -----> nbdkit-curl-plugin --> xz filter --> qcow2 snapshot
+ <-- sparsify
+ <-- deactivate cloud-init
+ <-- write a file
+ --> qemu-img convert
+
+DEMO:
+
+ nbdkit curl https://download.fedoraproject.org/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.raw.xz --filter=xz
+ qemu-img create -f qcow2 -b nbd://localhost -F raw snapshot.qcow2
+ virt-sparsify --inplace snapshot.qcow2
+ virt-customize -a snapshot.qcow2 \
+ --run-command 'systemctl disable cloud-init' \
+ --write /hello:HELLO
+ ls -lsh snapshot.qcow2
+ qemu-img convert -f qcow2 snapshot.qcow2 -O raw local.img -p
+ guestfish --ro -a local.img -i ll /
+
+
+Complete virt-v2v pipelines
+----------------------------------------------------------------------
+
+DIAGRAM:
+
+ proprietary
+ transport
+ VMware -----> nbdkit ----> nbdkit ----> qcow2
+ ESXi vddk rate snapshot
+ plugin filter
+
+ qcow2 <---- sparsify
+ snapshot <---- install drivers
+ -----> qemu-img convert
+
+ nbd HTTPS
+ qemu-img convert ----> nbdkit -----> imageio
+ python
+ plugin
+
+Discuss:
+
+ - separate input and output sides
+
+ - NBD used extensively
+
+ - very efficient and no large temporary copies
+
+ - virt-v2v may be on a separate machine
+
+ - rate filter
+
+ - many other tricks used
+
+
+
+Conclusions
+----------------------------------------------------------------------
+
+Disk image pipelines:
+
+ - efficient
+
+ - flexible
+
+ - avoid local copies
+
+ - avoid copying zeroes/sparseness/deleted data
+
+ - sparsification
+
+ - modifications in flight
+
+
+Future work / other topics
+----------------------------------------------------------------------
+
+nbdcopy vs qemu-img convert
+
+copy-on-read, bounded caches
+
+block size adjustment
+
+reading from containers
+
+stop using gzip!
+
+
+References
+----------------------------------------------------------------------
+
+http://git.annexia.org/?p=libguestfs-talks.git;a=tree;f=2021-pipelines
+
+https://gitlab.com/nbdkit
+
+https://libguestfs.org