[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exporting qcow2 images as raw data from ova file with qemu-nbd

From: Jakob Bohm
Subject: Re: Exporting qcow2 images as raw data from ova file with qemu-nbd
Date: Tue, 23 Jun 2020 21:10:39 +0200
User-agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

On 2020-06-23 16:08, Richard W.M. Jones wrote:
On Tue, Jun 23, 2020 at 08:47:52AM -0500, Eric Blake wrote:
On 6/22/20 5:21 PM, Nir Soffer wrote:
And it works, but it exposes the qcow2 data. I want to raw data so I
can upload the guest
data to ovirt, where is may be converted to qcow2 format.
Nir, can you use qemu-img convert and get a free conversion to your
choice of format?  This works fine over NBD as long as you don't try
and write which I guess you don't want to do here.

Richard suggested to try nbdkit tar plugin, but the plugin is not
available on RHEL,
and this adds additional dependency, when we already use qemu-nbd.
Rich just rewrote the tar plugin to use python instead of perl,
which means it is that much easier for a future RHEL to pull it in.
We still ought to consider having a tar filter, either in place of
or in addition to, the tar plugin (similar to how we recently
converted nbdkit's ext4 support from a plugin to a filter) - having
a tar filter would allow you to read a compressed ova file (by
combining the xz and tar filters to decompress then extract a file).
But right now, nbdkit doesn't support non-C filters (and given that
our tar plugin was written first in perl and now in python, that
still means translation to yet another language if the filter
requires it to be in C).
The reason it was in Perl and is now in Python (and not C), and also
the reason it still a plugin, is that parsing tar files is very
complex because of historical compatibility.  If we accept that we
cannot write a from-scratch tar file parser in C then we have to use
an existing tool or library (‘tar’ itself was used by Perl, now we're
using ‘tarfile.py’ from Python stdlib).  Those tools require access to
an actual local file.  So I'm afraid this rewrite is hard work :-)

Unless we accept that we only parse files created by a narrow range of
tools, but the problem is that OVA files can be generated by a wide
variety of tools.

If you can supply the offset by some other means then of course using
nbdkit-offset-filter or qemu's offset block layer is the solution.
Note that the BSD implementation of tar (in C) is available as a library,
which is also available on some Linux systems.


Jakob Bohm, CIO, Partner, WiseMo A/S.  https://www.wisemo.com
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded

reply via email to

[Prev in Thread] Current Thread [Next in Thread]