Hello Alberto,
On Mon, 10 Jun 2024 17:47, Alberto Garcia <be...@igalia.com> wrote:
This tool converts a disk image to qcow2, writing the result directly
to stdout. This can be used for example to send the generated file
over the network.
This is equivalent to using qemu-img to convert a file to qcow2 and
then writing the result to stdout, with the difference that this tool
does not need to create this temporary qcow2 file and therefore does
not need any additional disk space.
Can you expand on this a little bit? Would modifying qemu-img to write
to stdout if given, say, - instead of a file output path be enough to
make this script unnecessary?
The input file is read twice. The first pass is used to determine
which clusters contain non-zero data and that information is used to
create the qcow2 header, refcount table and blocks, and L1 and L2
tables. After all that metadata is created then the second pass is
used to write the guest data.
By default qcow2-to-stdout.py expects the input to be a raw file, but
if qemu-storage-daemon is available then it can also be used to read
images in other formats. Alternatively the user can also run qemu-ndb
or qemu-storage-daemon manually instead.
Signed-off-by: Alberto Garcia <be...@igalia.com>
Signed-off-by: Madeeha Javed <ja...@igalia.com>
---