Blame SOURCES/libvirt-admin-Fix-default-uri-config-option-name-s-admin_uri_default-uri_default.patch

6ae9ed
From a13eac3b9909d824e1f821b869ae166a25479121 Mon Sep 17 00:00:00 2001
6ae9ed
Message-Id: <a13eac3b9909d824e1f821b869ae166a25479121@dist-git>
6ae9ed
From: Erik Skultety <eskultet@redhat.com>
6ae9ed
Date: Tue, 16 Aug 2016 13:06:03 +0200
6ae9ed
Subject: [PATCH] admin: Fix default uri config option name
6ae9ed
 s/admin_uri_default/uri_default
6ae9ed
6ae9ed
The original name 'admin_uri_default' was introduced to our code by commit
6ae9ed
dbecb87f. However, at that time we already had a separate config file for
6ae9ed
admin library but the commit mentioned above didn't properly adjust the
6ae9ed
config's option name. The result is that when we're loading the config, we
6ae9ed
check a non-existent config option (there's not much to do with the URIs
6ae9ed
anyway, since we only allow local connection). Additionally, virt-admin's man
6ae9ed
page documents, that the default URI can be altered by setting
6ae9ed
admin_uri_default option. So the fix proposed by this patch leaves the
6ae9ed
libvirt-admin.conf as is and adjusts the naming in the code as well as in the
6ae9ed
virt-admin's man page.
6ae9ed
6ae9ed
Signed-off-by: Erik Skultety <eskultet@redhat.com>
6ae9ed
(cherry picked from commit f5f32bcd1bb7d96b38c34a85658ac0996683f8bc)
6ae9ed
6ae9ed
https://bugzilla.redhat.com/show_bug.cgi?id=1367269
6ae9ed
Signed-off-by: Erik Skultety <eskultet@redhat.com>
6ae9ed
6ae9ed
 Conflicts:
6ae9ed
	src/libvirt-admin.c - conflicts caused by downstream commit 00f1be9c
6ae9ed
        which had to be modified compared to its upstream original f5da0d18
6ae9ed
        that was relying on some newly added accessors which were not
6ae9ed
        backported.
6ae9ed
---
6ae9ed
 src/libvirt-admin.c  | 4 ++--
6ae9ed
 tools/virt-admin.pod | 7 ++++---
6ae9ed
 2 files changed, 6 insertions(+), 5 deletions(-)
6ae9ed
6ae9ed
diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c
6ae9ed
index c485752..f3bbe8c 100644
6ae9ed
--- a/src/libvirt-admin.c
6ae9ed
+++ b/src/libvirt-admin.c
6ae9ed
@@ -169,10 +169,10 @@ virAdmGetDefaultURI(virConfPtr conf, char **uristr)
6ae9ed
             return -1;
6ae9ed
         VIR_DEBUG("Using LIBVIRT_ADMIN_DEFAULT_URI '%s'", *uristr);
6ae9ed
     } else {
6ae9ed
-        if ((value = virConfGetValue(conf, "admin_uri_default"))) {
6ae9ed
+        if ((value = virConfGetValue(conf, "uri_default"))) {
6ae9ed
             if (value->type != VIR_CONF_STRING) {
6ae9ed
                 virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
6ae9ed
-                               _("Expected a string for 'admin_uri_default' "
6ae9ed
+                               _("Expected a string for 'uri_default' "
6ae9ed
                                  "config parameter"));
6ae9ed
                 return -1;
6ae9ed
             }
6ae9ed
diff --git a/tools/virt-admin.pod b/tools/virt-admin.pod
6ae9ed
index afc4689..49b267f 100644
6ae9ed
--- a/tools/virt-admin.pod
6ae9ed
+++ b/tools/virt-admin.pod
6ae9ed
@@ -127,7 +127,7 @@ Will print the current directory.
6ae9ed
 
6ae9ed
 (Re)-Connect to a daemon's administrating server. The I<URI> parameter
6ae9ed
 specifies how to connect to the administrating server.
6ae9ed
-If I<LIBVIRT_ADMIN_DEFAULT_URI> or I<admin_uri_default> (see below) were set,
6ae9ed
+If I<LIBVIRT_ADMIN_DEFAULT_URI> or I<uri_default> (see below) were set,
6ae9ed
 I<connect> is automatically issued every time a command that requires an
6ae9ed
 active connection is executed. Note that this only applies if there is no
6ae9ed
 connection at all or there is an inactive one.
6ae9ed
@@ -140,8 +140,9 @@ L<http://libvirt.org/uri.html> on how to make URIs.
6ae9ed
 =item B<uri>
6ae9ed
 
6ae9ed
 Prints the administrating server canonical URI, can be useful in shell mode. If
6ae9ed
-no I<uri> was specified, neither I<LIBVIRT_ADMIN_DEFAULT_URI> or
6ae9ed
-I<admin_uri_default> were set, libvirtd:///system is used.
6ae9ed
+no I<uri> was specified, neither I<LIBVIRT_ADMIN_DEFAULT_URI> environment
6ae9ed
+variable nor I<uri_default> option (libvirt-admin.conf) were set,
6ae9ed
+libvirtd:///system is used.
6ae9ed
 
6ae9ed
 =back
6ae9ed
 
6ae9ed
-- 
6ae9ed
2.9.2
6ae9ed