Re: [Libguestfs] [PATCH 1/2] src: start unifying version handling

Richard W.M. Jones
Tue, 17 May 2016 14:45:42 -0000

On Tue, May 17, 2016 at 03:41:10PM +0200, Pino Toscano
wrote:
> +extern bool guestfs_int_version_is (const struct version *v, int maj, int
min, int mic);

I think calling this function "is" is a bit misleading.  I think
we should have _ge and _le functions (cf my patch).

This comparison for example is wrong:

>    /* qemu 1.1 claims to support virtio-scsi but in reality it's
broken. */
> -  if (data->qemu_version_major == 1 &&
data->qemu_version_minor < 2)
> +  if (!guestfs_int_version_is (&data->qemu_version, 1, 2, 0))
>      return 1;

However the idea is sound.

Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.