build: Update govirt and rest requirements

With these new values, 0.3.3 for libgovirt and 0.8 for librest, we can
remove checks for OVIRT_REST_CALL_ERROR_CANCELLED and correspondent
rest_proxy_auth_cancel().

Distros that already ship these versions, such as Fedora, RHEL 7.4
onwards, and Ubuntu since 17.10.

Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
This commit is contained in:
Eduardo Lima (Etrunko) 2018-05-31 13:51:25 -03:00
parent 7ffb7f9cf4
commit 5ba2f8ff1b
2 changed files with 4 additions and 11 deletions

View File

@ -26,7 +26,8 @@ LIBVIRT_GLIB_REQUIRED="0.1.8"
GTK_VNC_REQUIRED="0.4.0"
SPICE_GTK_REQUIRED="0.35"
SPICE_PROTOCOL_REQUIRED="0.12.7"
GOVIRT_REQUIRED="0.3.2"
GOVIRT_REQUIRED="0.3.3"
REST_REQUIRED="0.8"
AC_SUBST([GLIB2_REQUIRED])
AC_SUBST([LIBXML2_REQUIRED])
@ -37,6 +38,7 @@ AC_SUBST([GTK_VNC_REQUIRED])
AC_SUBST([SPICE_GTK_REQUIRED])
AC_SUBST([SPICE_PROTOCOL_REQUIRED])
AC_SUBST([GOVIRT_REQUIRED])
AC_SUBST([REST_REQUIRED])
AC_MSG_CHECKING([for native Win32])
case "$host_os" in
@ -178,17 +180,12 @@ AS_IF([test "x$with_ovirt" != "xno" && test "x$with_ovirt" != "xyes"],
[with_ovirt=yes], [with_ovirt=no])])
AS_IF([test "x$with_ovirt" = "xyes"],
[PKG_CHECK_MODULES([OVIRT], [govirt-1.0 >= $GOVIRT_REQUIRED])]
[PKG_CHECK_MODULES([OVIRT], [govirt-1.0 >= $GOVIRT_REQUIRED rest-0.7 >= REST_REQUIRED])]
[AC_DEFINE([HAVE_OVIRT], 1, [Have libgovirt?])]
[SAVED_CFLAGS="$CFLAGS"
SAVED_LIBS="$LIBS"
CFLAGS="$OVIRT_CFLAGS"
LIBS="$OVIRT_LIBS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <govirt/govirt.h>]],
[static int err = OVIRT_REST_CALL_ERROR_CANCELLED;
void *fun = rest_proxy_auth_cancel;])],
[AC_DEFINE([HAVE_OVIRT_CANCEL], 1, [Have rest_proxy_auth_cancel and OVIRT_REST_CALL_ERROR_CANCELLED?])],
[])
AC_CHECK_FUNCS([ovirt_api_search_vms ovirt_vm_get_host ovirt_host_get_cluster ovirt_cluster_get_data_center],
[AC_DEFINE([HAVE_OVIRT_DATA_CENTER], 1, [Have support for data center])],
[]

View File

@ -345,10 +345,8 @@ authenticate_cb(RestProxy *proxy, G_GNUC_UNUSED RestProxyAuth *auth,
"username", username,
"password", password,
NULL);
#ifdef HAVE_OVIRT_CANCEL
} else {
rest_proxy_auth_cancel(auth);
#endif
}
g_free(username);
@ -447,14 +445,12 @@ create_ovirt_session(VirtViewerApp *app, const char *uri, GError **err)
api = ovirt_proxy_fetch_api(proxy, &error);
if (error != NULL) {
g_debug("failed to get oVirt 'api' collection: %s", error->message);
#ifdef HAVE_OVIRT_CANCEL
if (g_error_matches(error, OVIRT_REST_CALL_ERROR, OVIRT_REST_CALL_ERROR_CANCELLED)) {
g_clear_error(&error);
g_set_error_literal(&error,
VIRT_VIEWER_ERROR, VIRT_VIEWER_ERROR_CANCELLED,
_("Authentication was cancelled"));
}
#endif
goto error;
}
vms = ovirt_api_get_vms(api);