]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: bump min libxml2 to 2.9.1
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 22 Jul 2019 14:41:58 +0000 (15:41 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 9 Aug 2019 16:21:42 +0000 (17:21 +0100)
The various distros have the following libxml2 vesions:

        CentOS 7: 2.9.1
  Debian Stretch: 2.9.4
   FreeBSD Ports: 2.9.9
Ubuntu 16.04 LTS: 2.9.3

Based on this sampling, we can reasonably bump libxml2 min
version to 2.9.1

The 'query_raw' struct field was added in version 2.6.28,
so can be assumed to exist.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
m4/virt-libxml.m4
src/util/viruri.c
tests/viruritest.c

index 65012d506a8e97f44840ddd46a454e5c4cebec90..9aefbdc3f14ce1e274228e983075f19d09ab8d1c 100644 (file)
@@ -18,31 +18,17 @@ dnl <http://www.gnu.org/licenses/>.
 dnl
 
 AC_DEFUN([LIBVIRT_ARG_LIBXML], [
-  LIBVIRT_ARG_WITH([LIBXML], [libxml-2.0 (>= 2.6.0) location], [check])
+  LIBVIRT_ARG_WITH([LIBXML], [libxml-2.0 (>= 2.9.1) location], [check])
 ])
 
 AC_DEFUN([LIBVIRT_CHECK_LIBXML], [
-  LIBXML_REQUIRED="2.6.0"
+  LIBXML_REQUIRED="2.9.1"
 
   LIBVIRT_CHECK_PKG([LIBXML], [libxml-2.0], [$LIBXML_REQUIRED])
 
   if test "$with_libxml" = "no" ; then
     AC_MSG_ERROR([libxml2 >= $LIBXML_REQUIRED is required for libvirt])
   fi
-
-  dnl xmlURI structure has query_raw?
-  old_CFLAGS="$CFLAGS"
-  old_LIBS="$LIBS"
-  CFLAGS="$CFLAGS $LIBXML_CFLAGS"
-  LIBS="$LIBS $LIBXML_LIBS"
-
-  AC_CHECK_MEMBER([struct _xmlURI.query_raw],
-                  [AC_DEFINE([HAVE_XMLURI_QUERY_RAW], [1],
-                             [Have query_raw field in libxml2 xmlURI structure])],
-                  [], [#include <libxml/uri.h>])
-
-  CFLAGS="$old_CFLAGS"
-  LIBS="$old_LIBS"
 ])
 
 AC_DEFUN([LIBVIRT_RESULT_LIBXML], [
index 8e45a447b9b98b444f41a6596cabce40bd1de4f4..a43fe2afd4811fd80546396b94761e68a7c3673a 100644 (file)
@@ -183,13 +183,8 @@ virURIParse(const char *uri)
         ret->port = xmluri->port;
     if (VIR_STRDUP(ret->path, xmluri->path) < 0)
         goto error;
-#ifdef HAVE_XMLURI_QUERY_RAW
     if (VIR_STRDUP(ret->query, xmluri->query_raw) < 0)
         goto error;
-#else
-    if (VIR_STRDUP(ret->query, xmluri->query) < 0)
-        goto error;
-#endif
     if (VIR_STRDUP(ret->fragment, xmluri->fragment) < 0)
         goto error;
     if (VIR_STRDUP(ret->user, xmluri->user) < 0)
@@ -237,11 +232,7 @@ virURIFormat(virURIPtr uri)
     xmluri.server = uri->server;
     xmluri.port = uri->port;
     xmluri.path = uri->path;
-#ifdef HAVE_XMLURI_QUERY_RAW
     xmluri.query_raw = uri->query;
-#else
-    xmluri.query = uri->query;
-#endif
     xmluri.fragment = uri->fragment;
     xmluri.user = uri->user;
 
index c09e5323bc4d1e33e7ab4f13f7a9944235123b4c..d419711135859e55a529e3e660a6da7f53ccf2ad 100644 (file)
@@ -196,23 +196,19 @@ mymain(void)
         { (char*)"foo", (char*)"two", false },
         { NULL, NULL, false },
     };
-#ifdef HAVE_XMLURI_QUERY_RAW
     virURIParam params3[] = {
         { (char*)"foo", (char*)"&one", false },
         { (char*)"bar", (char*)"&two", false },
         { NULL, NULL, false },
     };
-#endif
     virURIParam params4[] = {
         { (char*)"foo", (char*)"", false },
         { NULL, NULL, false },
     };
-#ifdef HAVE_XMLURI_QUERY_RAW
     virURIParam params5[] = {
         { (char*)"foo", (char*)"one two", false },
         { NULL, NULL, false },
     };
-#endif
     virURIParam params6[] = {
         { (char*)"foo", (char*)"one", false },
         { NULL, NULL, false },
@@ -222,16 +218,12 @@ mymain(void)
     TEST_PARAMS("foo=one&foo=two", "", params2);
     TEST_PARAMS("foo=one&&foo=two", "foo=one&foo=two", params2);
     TEST_PARAMS("foo=one;foo=two", "foo=one&foo=two", params2);
-#ifdef HAVE_XMLURI_QUERY_RAW
     TEST_PARAMS("foo=%26one&bar=%26two", "", params3);
-#endif
     TEST_PARAMS("foo", "foo=", params4);
     TEST_PARAMS("foo=", "", params4);
     TEST_PARAMS("foo=&", "foo=", params4);
     TEST_PARAMS("foo=&&", "foo=", params4);
-#ifdef HAVE_XMLURI_QUERY_RAW
     TEST_PARAMS("foo=one%20two", "", params5);
-#endif
     TEST_PARAMS("=bogus&foo=one", "foo=one", params6);
 
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;