[Pkg-libvirt-commits] [libvirt] 02/02: util: Prepare URI formatting for libxml2 >= 2.9.2

Guido Guenther agx at moszumanska.debian.org
Sun Nov 23 13:55:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

agx pushed a commit to branch master
in repository libvirt.

commit 9aa75f764f4b1f5da4e7d91eea173a7055bf339d
Author: Guido Günther <agx at sigxcpu.org>
Date:   Sun Nov 23 14:33:39 2014 +0100

    util: Prepare URI formatting for libxml2 >= 2.9.2
    
    Closes: #769653
---
 debian/patches/series                              |  1 +
 ...-Prepare-URI-formatting-for-libxml2-2.9.2.patch | 44 ++++++++++++++++++++++
 2 files changed, 45 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index efb2b9c..cfa566c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -15,3 +15,4 @@ debian/Use-sensible-editor-as-fallback.patch
 debian/Debianize-virtlockd.patch
 qemu-use-systemd-s-TerminateMachine-to-kill-all-proc.patch
 security/CVE-2014-7823-dumpxml-security-hole-with-migratable-.patch
+util-Prepare-URI-formatting-for-libxml2-2.9.2.patch
diff --git a/debian/patches/util-Prepare-URI-formatting-for-libxml2-2.9.2.patch b/debian/patches/util-Prepare-URI-formatting-for-libxml2-2.9.2.patch
new file mode 100644
index 0000000..9aa7ef8
--- /dev/null
+++ b/debian/patches/util-Prepare-URI-formatting-for-libxml2-2.9.2.patch
@@ -0,0 +1,44 @@
+From: Martin Kletzander <mkletzan at redhat.com>
+Date: Fri, 3 Oct 2014 18:27:01 +0200
+Subject: util: Prepare URI formatting for libxml2 >= 2.9.2
+
+Since commit 8eb55d782a2b9afacc7938694891cc6fad7b42a5 libxml2 removes
+two slashes from the URI when there is no server part.  This is fixed
+with beb7281055dbf0ed4d041022a67c6c5cfd126f25, but only if the calling
+application calls xmlSaveUri() on URI that xmlURIParse() parsed.  And
+that is not the case in virURIFormat().  virURIFormat() accepts
+virURIPtr that can be created without parsing it and we do that when we
+format network storage paths for gluster for example.  Even though
+virStorageSourceParseBackingURI() uses virURIParse(), it throws that data
+structure right away.
+
+Since we want to format URIs as URIs and not absolute URIs or opaque
+URIs (see RFC 3986), we can specify that with a special hack thanks to
+commit beb7281055dbf0ed4d041022a67c6c5cfd126f25, by setting port to -1.
+
+This fixes qemuxml2argvtest test where the disk-drive-network-gluster
+case was failing.
+
+Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
+---
+ src/util/viruri.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/util/viruri.c b/src/util/viruri.c
+index 69e7649..23d86c5 100644
+--- a/src/util/viruri.c
++++ b/src/util/viruri.c
+@@ -254,6 +254,13 @@ virURIFormat(virURIPtr uri)
+         xmluri.server = tmpserver;
+     }
+ 
++    /*
++     * This helps libxml2 deal with the difference
++     * between uri:/absolute/path and uri:///absolute/path.
++     */
++    if (!xmluri.server && !xmluri.port)
++        xmluri.port = -1;
++
+     ret = (char *)xmlSaveUri(&xmluri);
+     if (!ret) {
+         virReportOOMError();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libvirt.git



More information about the Pkg-libvirt-commits mailing list