--- /dev/null
+benchmarking/local.img
+*.qcow2
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+set -x
+set -e
+
+source settings.sh
+
+file=$dir/fedora-33.img
+
+virt-builder fedora-33 --size 32G -o $file
+virt-customize -a $file \
+ --run-command 'dd if=/dev/urandom of=/var/tmp/big bs=1M count=3000 &&
+ sync &&
+ rm /var/tmp/big'
--- /dev/null
+export LIBGUESTFS_BACKEND=direct
+
+remote=kool
+dir=/mnt/scratch/pipes
+ova=$HOME/test.ova
--- /dev/null
+#!/bin/bash
+set -x
+set -e
+
+source settings.sh
+
+qemu-img create -f qcow2 -b ssh://$remote/$dir/fedora-33.img snapshot.qcow2
+virt-sparsify --inplace snapshot.qcow2
+qemu-img convert -f qcow2 snapshot.qcow2 -O raw local.img
--- /dev/null
+#!/bin/bash
+set -x
+set -e
+
+source settings.sh
+
+qemu-img create -f qcow2 -b ssh://$remote/$dir/fedora-33.img snapshot.qcow2
+qemu-img convert -f qcow2 snapshot.qcow2 -O raw local.img
--- /dev/null
+#!/bin/bash
+set -x
+set -e
+
+source settings.sh
+
+nbdkit -f --exit-with-parent --filter=cow ssh host=$remote $dir/fedora-33.img &
+sleep 1
+guestfish <<EOF
+ add "" protocol:nbd server:tcp:localhost discard:enable format:raw
+ run
+ mount-options discard /dev/sda2 /
+ fstrim /
+ umount /
+ mount-options discard /dev/sda3 /
+ fstrim /
+ umount /
+EOF
+nbdcopy nbd://localhost local.img
--- /dev/null
+#!/bin/bash
+set -x
+set -e
+
+source settings.sh
+
+nbdkit -f --exit-with-parent --filter=tar file $ova tar-entry=fedora-33.img &
+sleep 0.5
+qemu-img create -f qcow2 -b nbd:localhost:10809 snapshot.qcow2
+virt-sparsify --inplace snapshot.qcow2
+qemu-img convert -f qcow2 snapshot.qcow2 -O raw local.img