[libvirt] Remove more hardcoded paths from libvirtd --help

In my previous 2 patches, I used constants defined in remote_driver.h to build privileged libvirtd --help output. However, there are a few more constants in this header that we can use to build the --help output, this series addresses that. Christophe

It's not used anywhere, but should be pointing to $sysconfdir/libvirt/libvirtd.conf, not $sysconfdir/libvirtd.conf --- src/remote/remote_driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/remote/remote_driver.h b/src/remote/remote_driver.h index da353f3..912f0f8 100644 --- a/src/remote/remote_driver.h +++ b/src/remote/remote_driver.h @@ -37,7 +37,7 @@ unsigned long remoteVersion(void); # define LIBVIRTD_PRIV_UNIX_SOCKET LOCALSTATEDIR "/run/libvirt/libvirt-sock" # define LIBVIRTD_PRIV_UNIX_SOCKET_RO LOCALSTATEDIR "/run/libvirt/libvirt-sock-ro" # define LIBVIRTD_USER_UNIX_SOCKET "libvirt-sock" -# define LIBVIRTD_CONFIGURATION_FILE SYSCONFDIR "/libvirtd.conf" +# define LIBVIRTD_CONFIGURATION_FILE SYSCONFDIR "/libvirt/libvirtd.conf" /* Defaults for PKI directory. */ # define LIBVIRT_PKI_DIR SYSCONFDIR "/pki" -- 1.8.3.1

On 09/18/2013 09:36 AM, Christophe Fergeau wrote:
It's not used anywhere, but should be pointing to $sysconfdir/libvirt/libvirtd.conf, not $sysconfdir/libvirtd.conf --- src/remote/remote_driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/remote/remote_driver.h b/src/remote/remote_driver.h index da353f3..912f0f8 100644 --- a/src/remote/remote_driver.h +++ b/src/remote/remote_driver.h @@ -37,7 +37,7 @@ unsigned long remoteVersion(void); # define LIBVIRTD_PRIV_UNIX_SOCKET LOCALSTATEDIR "/run/libvirt/libvirt-sock" # define LIBVIRTD_PRIV_UNIX_SOCKET_RO LOCALSTATEDIR "/run/libvirt/libvirt-sock-ro" # define LIBVIRTD_USER_UNIX_SOCKET "libvirt-sock" -# define LIBVIRTD_CONFIGURATION_FILE SYSCONFDIR "/libvirtd.conf" +# define LIBVIRTD_CONFIGURATION_FILE SYSCONFDIR "/libvirt/libvirtd.conf"
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

A previous patch used existing #define for the various in /etc/pki instead of hardcoding them in the help output. However I missed that remote_driver.h contains #define for more paths that are present in the daemon help output. This commit uses the existing constants for the path to the configuration file and to the libvirt sockets. --- daemon/libvirtd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index f714cb1..99c0342 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -1056,11 +1056,11 @@ daemonUsage(const char *argv0, bool privileged) " Default paths:\n" "\n" " Configuration file (unless overridden by -f):\n" - " %s/libvirt/libvirtd.conf\n" + " %s\n" "\n" " Sockets:\n" - " %s/run/libvirt/libvirt-sock\n" - " %s/run/libvirt/libvirt-sock-ro\n" + " %s\n" + " %s\n" "\n" " TLS:\n" " CA certificate: %s\n" @@ -1070,9 +1070,9 @@ daemonUsage(const char *argv0, bool privileged) " PID file (unless overridden by -p):\n" " %s/run/libvirtd.pid\n" "\n"), - SYSCONFDIR, - LOCALSTATEDIR, - LOCALSTATEDIR, + LIBVIRTD_CONFIGURATION_FILE, + LIBVIRTD_PRIV_UNIX_SOCKET, + LIBVIRTD_PRIV_UNIX_SOCKET_RO, LIBVIRT_CACERT, LIBVIRT_SERVERCERT, LIBVIRT_SERVERKEY, -- 1.8.3.1

On 09/18/2013 09:36 AM, Christophe Fergeau wrote:
A previous patch used existing #define for the various in /etc/pki instead of hardcoding them in the help output. However I missed that remote_driver.h contains #define for more paths that are present in the daemon help output. This commit uses the existing constants for the path to the configuration file and to the libvirt sockets. --- daemon/libvirtd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Christophe Fergeau
-
Eric Blake