qemu-discuss
[Top][All Lists]
Advanced

[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: Richard W.M. Jones
Subject: Re: Exporting qcow2 images as raw data from ova file with qemu-nbd
Date: Tue, 23 Jun 2020 15:08:51 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v




reply via email to

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