diff options
author | Martin Kletzander <mkletzan@redhat.com> | 2012-02-24 19:48:55 +0100 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2012-02-24 16:49:21 -0700 |
commit | 9f748277bbd17d031f80d28e6d2fc4b52e8d5715 (patch) | |
tree | d01b242c29bb10c50a96918e55e7c70d0dc8d570 /src/vbox | |
parent | Fixed service handling in specfile (diff) | |
download | libvirt-9f748277bbd17d031f80d28e6d2fc4b52e8d5715.tar.gz libvirt-9f748277bbd17d031f80d28e6d2fc4b52e8d5715.tar.bz2 libvirt-9f748277bbd17d031f80d28e6d2fc4b52e8d5715.zip |
Fixed URI parsing
Function xmlParseURI does not remove square brackets around IPv6
address when parsing. One of the solutions is making wrappers around
functions working with xmlURI*. This assures that uri->server will be
always properly assigned and it doesn't have to be changed when used
on some new place in the code.
For this purpose, functions virParseURI and virSaveURI were
added. These function are wrappers around xmlParseURI and xmlSaveUri
respectively.
Also there is one new syntax check function to prohibit these functions
anywhere else.
File changes:
- src/util/viruri.h -- declaration
- src/util/viruri.c -- definition
- src/libvirt_private.syms -- symbol export
- src/Makefile.am -- added source and header files
- cfg.mk -- added sc_prohibit_xmlURI
- all others -- ID name and include fixes
Diffstat (limited to 'src/vbox')
-rw-r--r-- | src/vbox/vbox_tmpl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index b168c7db3..a39b5677b 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -56,6 +56,7 @@ #include "configmake.h" #include "virfile.h" #include "fdstream.h" +#include "viruri.h" /* This one changes from version to version. */ #if VBOX_API_VERSION == 2002 @@ -980,7 +981,7 @@ static virDrvOpenStatus vboxOpen(virConnectPtr conn, virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); if (conn->uri == NULL) { - conn->uri = xmlParseURI(uid ? "vbox:///session" : "vbox:///system"); + conn->uri = virURIParse(uid ? "vbox:///session" : "vbox:///system"); if (conn->uri == NULL) { virReportOOMError(); return VIR_DRV_OPEN_ERROR; |