Re: [PATCH] Switch to use libvirt-glib for events

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

 



On Wed, Jan 29, 2014 at 04:19:49PM +0000, Daniel P. Berrange wrote:
> Rather than using a custom written glib <-> libvirt event
> loop implementation, make use of libvirt-glib. This will
> solve a number of bugs in the current impl.
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  README                    |   4 +-
>  configure.ac              |  16 +-
>  mingw-virt-viewer.spec.in |   2 +
>  src/Makefile.am           |   3 +-
>  src/virt-viewer-events.c  | 364 ----------------------------------------------
>  src/virt-viewer-events.h  |  37 -----
>  src/virt-viewer-main.c    |   3 +
>  src/virt-viewer.c         |   4 +-
>  virt-viewer.spec.in       |   1 +
>  9 files changed, 26 insertions(+), 408 deletions(-)
>  delete mode 100644 src/virt-viewer-events.c
>  delete mode 100644 src/virt-viewer-events.h
> 
> diff --git a/README b/README
> index 8170b59..000e872 100644
> --- a/README
> +++ b/README
> @@ -28,8 +28,8 @@ Use of either SPICE-GTK or GTK-VNC can be disabled at time
>  of configure, with --without-gtk-vnc or --without-spice-gtk
>  respectively.
>  
> -Virt Viewer uses libvirt to lookup information about the
> -guest OS display. This is available from
> +Virt Viewer uses libvirt and libvirt-glib to lookup information
> +about the guest OS display. These are available from
>  
>    http://libvirt.org/
>  
> diff --git a/configure.ac b/configure.ac
> index 7a00bf4..56c3539 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -15,6 +15,7 @@ AM_SILENT_RULES([yes])
>  GLIB2_REQUIRED=2.22.0
>  LIBXML2_REQUIRED="2.6.0"
>  LIBVIRT_REQUIRED="0.10.0"
> +LIBVIRT_GLIB_REQUIRED="0.1.0"
>  GTK2_REQUIRED="2.18.0"
>  GTK3_REQUIRED="3.0"
>  GTK_VNC1_REQUIRED="0.3.8"
> @@ -26,6 +27,7 @@ GOVIRT_REQUIRED="0.3.0"
>  AC_SUBST([GLIB2_REQUIRED])
>  AC_SUBST([LIBXML2_REQUIRED])
>  AC_SUBST([LIBVIRT_REQUIRED])
> +AC_SUBST([LIBVIRT_GLIB_REQUIRED])
>  AC_SUBST([GTK2_REQUIRED])
>  AC_SUBST([GTK3_REQUIRED])
>  AC_SUBST([GTK_VNC1_REQUIRED])
> @@ -105,8 +107,16 @@ AC_ARG_WITH([libvirt],
>  
>  AS_IF([test "x$with_libvirt" != "xno"],
>        [PKG_CHECK_MODULES(LIBVIRT,
> -                         [libvirt >= $LIBVIRT_REQUIRED],
> -                         [have_libvirt=yes], [have_libvirt=no])],
> +         [libvirt >= $LIBVIRT_REQUIRED],
> +         [
> +           PKG_CHECK_MODULES(LIBVIRT_GLIB,
> +             [libvirt-glib-1.0 >= $LIBVIRT_GLIB_REQUIRED],
> +             [have_libvirt=yes],
> +             [have_libvirt=no
> +              LIBVIRT_CFLAGS=
> +              LIBVIRT_LIBS=])
> +         ],
> +         [have_libvirt=no])],
>        [have_libvirt=no])

If we don't mind having libvirt and libvirt-glib flags in the same
variables, this could also be written as
AS_IF([test "x$with_libvirt" != "xno"],
       [PKG_CHECK_MODULES(LIBVIRT,
-                         [libvirt >= $LIBVIRT_REQUIRED],
+                         [libvirt >= $LIBVIRT_REQUIRED libvirt-glib-1.0 >= $LIBVIRT_GLIB_REQUIRED],
                          [have_libvirt=yes], [have_libvirt=no])],
       [have_libvirt=no])

which is much simpler.

ACK to either version.

Christophe


Attachment: pgp2c6Uv_w5ci.pgp
Description: PGP signature

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list

[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux