[Libguestfs] [PATCH] RFC: rhv-upload-plugin: Use imageio client

Richard W.M. Jones rjones at redhat.com
Thu Jul 9 07:53:31 UTC 2020


On Thu, Jul 09, 2020 at 01:51:44AM +0300, Nir Soffer wrote:
> We can use now ImageioClient to communicate with ovirt-imageio server
> on oVirt host.
> 
> Using the client greatly simplifies the plugin, and enables new features
> like transparent proxy support. The client will use transfer_url if
> possible, or fall back to proxy_url.
> 
> Since the client implements the buffer protocol, move to version 2 of
> the API for more efficient pread().

This will require nbdkit >= 1.17.3 which implies RHEL AV 8.3.0, but
that's fine since we only ship the new virt-v2v (>= 1.42) on AV 8.3.0.

> Another advantage the client is maintained by oVirt, and fixes are
> delivered quickly in oVirt, without depending on RHEL release schedule.
> 
> Not ready yet, we have several issues:
> 
> - The client does not support "http", so the tests will fail now. This
>   is good since we should test with real imageio server. I will work on
>   better tests later.

I think having standalone tests is still worthwhile as it's the only
way that the plugin gets tested on a regular basis.  IIRC at the
moment we only test against a faked ovirt SDK.  I guess this would be
easy to adjust?

To unit test against a real imageio server is difficult I think: These
tests would need to run in Fedora with minimal large dependencies.  We
might create a fake web server like the one we use in nbdkit:

https://github.com/libguestfs/nbdkit/blob/master/tests/web-server.h
https://github.com/libguestfs/nbdkit/blob/master/tests/web-server.c

This only supports http but we could put stunnel in front to provide
https.

> - Need to require ovirt-imageio-client, providing the client library.

That's a simple change in virt-v2v packaging.  I don't see this
package in Fedora Koji.  In RHEL I can see the package and the
dependencies look quite light, basically just Python and python3-six.
Why is it only available for x86_64 and ppc64le?

> - params['rhv_direct'] is ignored, we always try direct transfer now.

We should drop it from the OCaml code?

[...]

> -# Modify http.client.HTTPConnection to work over a Unix domain socket.
> -# Derived from uhttplib written by Erik van Zijst under an MIT license.
> -# (https://pypi.org/project/uhttplib/)
> -# Ported to Python 3 by Irit Goihman.
> -
> -
> -class UnixHTTPConnection(HTTPConnection):

Why drop this part?

Rest of the patch looks good and as you say above both simplifies and
improves performance.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html




More information about the Libguestfs mailing list