[virt-tools-list] [PATCH] Switch to use libvirt-glib for events
Christophe Fergeau
cfergeau at redhat.com
Thu Jan 30 10:42:27 UTC 2014
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 at redhat.com>
> ---
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20140130/29bf3231/attachment.sig>
More information about the virt-tools-list
mailing list