From nobody Fri May 3 19:45:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563806892; cv=none; d=zoho.com; s=zohoarc; b=GOEECD0eTYPTaIEzGNNsUQFCPS9lspAq+Q7DS3me50Rkr4HNcGAs1DsW4wi7/B95wcs3VjbK7O3leHM51nLP7TQPzLXihHcbojbclww0a8oYfQ+NmyYfsoI93FBE9eIQpJfs/4qPwlF9mqAcBWzQGiC4T/1qz6aEy0KsvNeME3Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563806892; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=EA9lORC28KhxncCShyVPAC7gc9fIfeOaZQCECSm4rh4=; b=lhDIaXFgd95XrnCEcfrGG6LFLToJOUme021J1Qk+F+NOYl2Sl8EoQPyl6/kzNaa55EVDBGxDdHdwKOj+z7WpfwB3JdNbov5dLr0ynHrpuP6RsAJnMz1cEcF7h+OjeLaW+j+wCKR7ykqPH1Vq1+wY0JMuc+CWPBY0h0QJhjQoluA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563806892616778.4405923387498; Mon, 22 Jul 2019 07:48:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C8F893154860; Mon, 22 Jul 2019 14:48:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4FE331001DE1; Mon, 22 Jul 2019 14:48:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 266B141F53; Mon, 22 Jul 2019 14:48:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6MEm20T024409 for ; Mon, 22 Jul 2019 10:48:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id D33ED19D7E; Mon, 22 Jul 2019 14:48:02 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43B9519D7C; Mon, 22 Jul 2019 14:47:59 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Mon, 22 Jul 2019 15:47:57 +0100 Message-Id: <20190722144757.26773-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] build: bump min libxml2 to 2.9.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 22 Jul 2019 14:48:12 +0000 (UTC) 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=C3=A9 --- m4/virt-libxml.m4 | 18 ++---------------- src/util/viruri.c | 9 --------- tests/viruritest.c | 8 -------- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/m4/virt-libxml.m4 b/m4/virt-libxml.m4 index 65012d506a..9aefbdc3f1 100644 --- a/m4/virt-libxml.m4 +++ b/m4/virt-libxml.m4 @@ -18,31 +18,17 @@ dnl . dnl =20 AC_DEFUN([LIBVIRT_ARG_LIBXML], [ - LIBVIRT_ARG_WITH([LIBXML], [libxml-2.0 (>=3D 2.6.0) location], [check]) + LIBVIRT_ARG_WITH([LIBXML], [libxml-2.0 (>=3D 2.9.1) location], [check]) ]) =20 AC_DEFUN([LIBVIRT_CHECK_LIBXML], [ - LIBXML_REQUIRED=3D"2.6.0" + LIBXML_REQUIRED=3D"2.9.1" =20 LIBVIRT_CHECK_PKG([LIBXML], [libxml-2.0], [$LIBXML_REQUIRED]) =20 if test "$with_libxml" =3D "no" ; then AC_MSG_ERROR([libxml2 >=3D $LIBXML_REQUIRED is required for libvirt]) fi - - dnl xmlURI structure has query_raw? - old_CFLAGS=3D"$CFLAGS" - old_LIBS=3D"$LIBS" - CFLAGS=3D"$CFLAGS $LIBXML_CFLAGS" - LIBS=3D"$LIBS $LIBXML_LIBS" - - AC_CHECK_MEMBER([struct _xmlURI.query_raw], - [AC_DEFINE([HAVE_XMLURI_QUERY_RAW], [1], - [Have query_raw field in libxml2 xmlURI struc= ture])], - [], [#include ]) - - CFLAGS=3D"$old_CFLAGS" - LIBS=3D"$old_LIBS" ]) =20 AC_DEFUN([LIBVIRT_RESULT_LIBXML], [ diff --git a/src/util/viruri.c b/src/util/viruri.c index 8e45a447b9..a43fe2afd4 100644 --- a/src/util/viruri.c +++ b/src/util/viruri.c @@ -183,13 +183,8 @@ virURIParse(const char *uri) ret->port =3D 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 =3D uri->server; xmluri.port =3D uri->port; xmluri.path =3D uri->path; -#ifdef HAVE_XMLURI_QUERY_RAW xmluri.query_raw =3D uri->query; -#else - xmluri.query =3D uri->query; -#endif xmluri.fragment =3D uri->fragment; xmluri.user =3D uri->user; =20 diff --git a/tests/viruritest.c b/tests/viruritest.c index c09e5323bc..d419711135 100644 --- a/tests/viruritest.c +++ b/tests/viruritest.c @@ -196,23 +196,19 @@ mymain(void) { (char*)"foo", (char*)"two", false }, { NULL, NULL, false }, }; -#ifdef HAVE_XMLURI_QUERY_RAW virURIParam params3[] =3D { { (char*)"foo", (char*)"&one", false }, { (char*)"bar", (char*)"&two", false }, { NULL, NULL, false }, }; -#endif virURIParam params4[] =3D { { (char*)"foo", (char*)"", false }, { NULL, NULL, false }, }; -#ifdef HAVE_XMLURI_QUERY_RAW virURIParam params5[] =3D { { (char*)"foo", (char*)"one two", false }, { NULL, NULL, false }, }; -#endif virURIParam params6[] =3D { { (char*)"foo", (char*)"one", false }, { NULL, NULL, false }, @@ -222,16 +218,12 @@ mymain(void) TEST_PARAMS("foo=3Done&foo=3Dtwo", "", params2); TEST_PARAMS("foo=3Done&&foo=3Dtwo", "foo=3Done&foo=3Dtwo", params2); TEST_PARAMS("foo=3Done;foo=3Dtwo", "foo=3Done&foo=3Dtwo", params2); -#ifdef HAVE_XMLURI_QUERY_RAW TEST_PARAMS("foo=3D%26one&bar=3D%26two", "", params3); -#endif TEST_PARAMS("foo", "foo=3D", params4); TEST_PARAMS("foo=3D", "", params4); TEST_PARAMS("foo=3D&", "foo=3D", params4); TEST_PARAMS("foo=3D&&", "foo=3D", params4); -#ifdef HAVE_XMLURI_QUERY_RAW TEST_PARAMS("foo=3Done%20two", "", params5); -#endif TEST_PARAMS("=3Dbogus&foo=3Done", "foo=3Done", params6); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list