[Libguestfs] [PATCH v2v] v2v: Allow output to block devices (RHBZ#1868690).

Nir Soffer nsoffer at redhat.com
Thu Sep 3 13:08:49 UTC 2020


On Thu, Sep 3, 2020 at 3:36 PM Richard W.M. Jones <rjones at redhat.com> wrote:
>
> On Tue, Sep 01, 2020 at 08:38:32PM +0100, Richard W.M. Jones wrote:
> > On Tue, Sep 01, 2020 at 10:08:24PM +0300, Nir Soffer wrote:
> > > > > I'm completely sure what the question means, but virt-v2v currently
> > > > > does this:
> > > > >
> > > > >   qemu-img create -f FORMAT filename
> > > > >   qemu-img convert -n overlay filename
> > >
> > > This works, we also do this with file and block devices in most cases.
> > >
> > > I was confused by:
> > >
> > > > > > > +            (* It turns out that libguestfs's disk creation code is
> > > > > > > +             * considerably more flexible and easier to use than
> > > > > > > +             * qemu-img, so create the disk explicitly using libguestfs
> > >
> > > I guess you don't create qcow2 image without qemu-img?
> > >
> > > > > The new code doesn't change that for files, but the proposal does
> > > > > change it for devices to only this command:
> > > > >
> > > > >   qemu-img convert -n overlay device
> > >
> > > This does not work for qcow2, since -n disable creation of the image.
> >
> > I'm going to have to play with this.  It may be that we need
> > to drop -n when using devices.
>
> I had a look at this and you're right:
>
> qemu-img: Could not open '/var/tmp/fedora-32-sda': Image is not in qcow2 format
>
> but maybe if people use block devices they should have to format them
> if they want to use qcow2?

It can work. In oVirt, when you get a block device with qcow2 format we already
created the image and you can use -n.

Other users can do the same, I don't know if there are any :-)

So supporting block devices and documenting that the user must prepare
the device
sounds like a good solution for now.

> One reason is that they would get control over the qcow2 parameters
> like cluster size, which would be hard to do if we had to pass them
> all through virt-v2v.  (Currently virt-v2v can only set qcow2
> compression.)

The compression is not part to the image, I think it affects only
qemu-img convert,
so must be something that virt-v2v will handle.

>
> Rich.
>
> --
> Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
> Read my programming and virtualization blog: http://rwmj.wordpress.com
> Fedora Windows cross-compiler. Compile Windows programs, test, and
> build Windows installers. Over 100 libraries supported.
> http://fedoraproject.org/wiki/MinGW
>




More information about the Libguestfs mailing list