mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-11-08 00:24:52 +03:00
maint: use gnulib configmake rather than open-coding things
* bootstrap.conf (gnulib_modules): Add configmake. * daemon/Makefile.am (libvirtd_CFLAGS): Drop defines provided by gnulib. * src/Makefile.am (INCLUDES): Likewise. * tests/Makefile.am (INCLUDES): Likewise. * tools/Makefile.am (virsh_CFLAGS): Likewise. * daemon/libvirtd.c (qemudInitPaths, usage, main): Update clients. * src/cpu/cpu_map.c (CPUMAPFILE): Likewise. * src/driver.c (DEFAULT_DRIVER_DIR): Likewise. * src/internal.h (_): Likewise. * src/libvirt.c (virInitialize): Likewise. * src/lxc/lxc_conf.h (LXC_CONFIG_DIR, LXC_STATE_DIR, LXC_LOG_DIR): Likewise. * src/lxc/lxc_conf.c (lxcCapsInit, lxcLoadDriverConfig): Likewise. * src/network/bridge_driver.c (NETWORK_PID_DIR) (NETWORK_STATE_DIR, DNSMASQ_STATE_DIR, networkStartup): Likewise. * src/nwfilter/nwfilter_driver.c (nwfilterDriverStartup): Likewise. * src/qemu/qemu_conf.c (qemudLoadDriverConfig): Likewise. * src/qemu/qemu_driver.c (qemudStartup): Likewise. * src/remote/remote_driver.h (LIBVIRTD_PRIV_UNIX_SOCKET) (LIBVIRTD_PRIV_UNIX_SOCKET_RO, LIBVIRTD_CONFIGURATION_FILE) (LIBVIRT_PKI_DIR): Likewise. * src/secret/secret_driver.c (secretDriverStartup): Likewise. * src/security/security_apparmor.c (VIRT_AA_HELPER): Likewise. * src/security/virt-aa-helper.c (main): Likewise. * src/storage/storage_backend_disk.c (PARTHELPER): Likewise. * src/storage/storage_driver.c (storageDriverStartup): Likewise. * src/uml/uml_driver.c (TEMPDIR, umlStartup): Likewise. * src/util/hooks.c (LIBVIRT_HOOK_DIR): Likewise. * tools/virsh.c (main): Likewise. * docs/hooks.html.in: Likewise.
This commit is contained in:
@@ -137,6 +137,8 @@ static int unix_sock_ro_mask = 0777; /* Allow world */
|
||||
|
||||
#endif /* __sun */
|
||||
|
||||
#include "configmake.h"
|
||||
|
||||
static int godaemon = 0; /* -d: Be a daemon */
|
||||
static int verbose = 0; /* -v: Verbose mode */
|
||||
static int timeout = -1; /* -t: Shutdown timeout */
|
||||
@@ -745,7 +747,7 @@ static int qemudInitPaths(struct qemud_server *server,
|
||||
/* The base_dir_prefix is the base under which all libvirtd
|
||||
* files live */
|
||||
if (server->privileged) {
|
||||
if (!(base_dir_prefix = strdup (LOCAL_STATE_DIR)))
|
||||
if (!(base_dir_prefix = strdup (LOCALSTATEDIR)))
|
||||
goto no_memory;
|
||||
} else {
|
||||
uid_t uid = geteuid();
|
||||
@@ -3038,9 +3040,9 @@ libvirt management daemon:\n\
|
||||
%s\n\
|
||||
\n"),
|
||||
argv0,
|
||||
SYSCONF_DIR,
|
||||
LOCAL_STATE_DIR,
|
||||
LOCAL_STATE_DIR,
|
||||
SYSCONFDIR,
|
||||
LOCALSTATEDIR,
|
||||
LOCALSTATEDIR,
|
||||
LIBVIRT_CACERT,
|
||||
LIBVIRT_SERVERCERT,
|
||||
LIBVIRT_SERVERKEY,
|
||||
@@ -3137,7 +3139,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
if (remote_config_file == NULL) {
|
||||
static const char *default_config_file
|
||||
= SYSCONF_DIR "/libvirt/libvirtd.conf";
|
||||
= SYSCONFDIR "/libvirt/libvirtd.conf";
|
||||
remote_config_file =
|
||||
(access(default_config_file, R_OK) == 0
|
||||
? default_config_file
|
||||
@@ -3169,7 +3171,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
/* Ensure the rundir exists (on tmpfs on some systems) */
|
||||
if (geteuid() == 0) {
|
||||
const char *rundir = LOCAL_STATE_DIR "/run/libvirt";
|
||||
const char *rundir = LOCALSTATEDIR "/run/libvirt";
|
||||
|
||||
if (mkdir (rundir, 0755)) {
|
||||
if (errno != EEXIST) {
|
||||
|
||||
Reference in New Issue
Block a user