mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 22:03:49 +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:
parent
8e3051af84
commit
0d5f54bb21
@ -25,6 +25,7 @@ c-ctype
|
||||
canonicalize-lgpl
|
||||
close
|
||||
connect
|
||||
configmake
|
||||
count-one-bits
|
||||
crypto/md5
|
||||
dirname-lgpl
|
||||
|
@ -85,12 +85,10 @@ libvirtd_CFLAGS = \
|
||||
-I$(top_srcdir)/src/remote \
|
||||
$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
|
||||
$(POLKIT_CFLAGS) \
|
||||
$(WARN_CFLAGS) -DLOCAL_STATE_DIR="\"$(localstatedir)\"" \
|
||||
$(WARN_CFLAGS) \
|
||||
$(COVERAGE_CFLAGS) \
|
||||
-DSYSCONF_DIR="\"$(sysconfdir)\"" \
|
||||
-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
|
||||
-DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\"" \
|
||||
-DGETTEXT_PACKAGE=\"$(PACKAGE)\"
|
||||
-DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\""
|
||||
|
||||
libvirtd_LDFLAGS = \
|
||||
$(WARN_CFLAGS) \
|
||||
|
@ -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) {
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
<h2><a name="location">Script location</a></h2>
|
||||
<p>The libvirt hook scripts are located in the directory
|
||||
<code>$SYSCONF_DIR/libvirt/hooks/</code>.</p>
|
||||
<code>$SYSCONFDIR/libvirt/hooks/</code>.</p>
|
||||
<ul>
|
||||
<li>In Linux distributions such as Fedora and RHEL, this is
|
||||
<code>/etc/libvirt/hooks/</code>. Other Linux distributions may do
|
||||
|
@ -11,14 +11,6 @@ INCLUDES = \
|
||||
-I@top_srcdir@/include \
|
||||
$(DRIVER_MODULE_CFLAGS) \
|
||||
$(LIBXML_CFLAGS) \
|
||||
-DLIBDIR=\""$(libdir)"\" \
|
||||
-DBINDIR=\""$(libexecdir)"\" \
|
||||
-DSBINDIR=\""$(sbindir)"\" \
|
||||
-DSYSCONF_DIR="\"$(sysconfdir)\"" \
|
||||
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
|
||||
-DPKGDATADIR=\""$(pkgdatadir)"\" \
|
||||
-DLOCAL_STATE_DIR=\""$(localstatedir)"\" \
|
||||
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
|
||||
$(WARN_CFLAGS) \
|
||||
$(LOCK_CHECKING_CFLAGS) \
|
||||
-DIN_LIBVIRT \
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* cpu_map.c: internal functions for handling CPU mapping configuration
|
||||
*
|
||||
* Copyright (C) 2009 Red Hat, Inc.
|
||||
* Copyright (C) 2009-2010 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -26,7 +26,7 @@
|
||||
#include "memory.h"
|
||||
#include "cpu.h"
|
||||
#include "cpu_map.h"
|
||||
|
||||
#include "configmake.h"
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_CPU
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* driver.c: Helpers for loading drivers
|
||||
*
|
||||
* Copyright (C) 2006-2009 Red Hat, Inc.
|
||||
* Copyright (C) 2006-2010 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -28,6 +28,7 @@
|
||||
#include "memory.h"
|
||||
#include "logging.h"
|
||||
#include "util.h"
|
||||
#include "configmake.h"
|
||||
|
||||
#define DEFAULT_DRIVER_DIR LIBDIR "/libvirt/drivers"
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
||||
# define INET_ADDRSTRLEN 16
|
||||
# endif
|
||||
|
||||
# define _(str) dgettext(GETTEXT_PACKAGE, (str))
|
||||
# define _(str) dgettext(PACKAGE, (str))
|
||||
# define N_(str) str
|
||||
|
||||
/* String equality tests, suggested by Jim Meyering. */
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "uuid.h"
|
||||
#include "util.h"
|
||||
#include "memory.h"
|
||||
#include "configmake.h"
|
||||
|
||||
#ifndef WITH_DRIVER_MODULES
|
||||
# ifdef WITH_TEST
|
||||
@ -342,7 +343,7 @@ virInitialize(void)
|
||||
if (winsock_init () == -1) return -1;
|
||||
#endif
|
||||
|
||||
if (!bindtextdomain(GETTEXT_PACKAGE, LOCALEBASEDIR))
|
||||
if (!bindtextdomain(PACKAGE, LOCALEDIR))
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Red Hat, Inc.
|
||||
* Copyright IBM Corp. 2008
|
||||
*
|
||||
* lxc_conf.c: config functions for managing linux containers
|
||||
@ -34,7 +35,7 @@
|
||||
#include "memory.h"
|
||||
#include "logging.h"
|
||||
#include "uuid.h"
|
||||
|
||||
#include "configmake.h"
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_LXC
|
||||
|
||||
@ -73,7 +74,7 @@ virCapsPtr lxcCapsInit(void)
|
||||
"exe",
|
||||
utsname.machine,
|
||||
sizeof(int) == 4 ? 32 : 8,
|
||||
BINDIR "/libvirt_lxc",
|
||||
LIBEXECDIR "/libvirt_lxc",
|
||||
NULL,
|
||||
0,
|
||||
NULL)) == NULL)
|
||||
@ -114,7 +115,7 @@ int lxcLoadDriverConfig(lxc_driver_t *driver)
|
||||
goto no_memory;
|
||||
|
||||
|
||||
if ((filename = strdup(SYSCONF_DIR "/libvirt/lxc.conf")) == NULL)
|
||||
if ((filename = strdup(SYSCONFDIR "/libvirt/lxc.conf")) == NULL)
|
||||
goto no_memory;
|
||||
|
||||
/* Avoid error from non-existant or unreadable file. */
|
||||
|
@ -33,10 +33,11 @@
|
||||
# include "capabilities.h"
|
||||
# include "threads.h"
|
||||
# include "cgroup.h"
|
||||
# include "configmake.h"
|
||||
|
||||
# define LXC_CONFIG_DIR SYSCONF_DIR "/libvirt/lxc"
|
||||
# define LXC_STATE_DIR LOCAL_STATE_DIR "/run/libvirt/lxc"
|
||||
# define LXC_LOG_DIR LOCAL_STATE_DIR "/log/libvirt/lxc"
|
||||
# define LXC_CONFIG_DIR SYSCONFDIR "/libvirt/lxc"
|
||||
# define LXC_STATE_DIR LOCALSTATEDIR "/run/libvirt/lxc"
|
||||
# define LXC_LOG_DIR LOCALSTATEDIR "/log/libvirt/lxc"
|
||||
# define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart"
|
||||
|
||||
typedef struct __lxc_driver lxc_driver_t;
|
||||
|
@ -58,11 +58,12 @@
|
||||
#include "logging.h"
|
||||
#include "dnsmasq.h"
|
||||
#include "util/network.h"
|
||||
#include "configmake.h"
|
||||
|
||||
#define NETWORK_PID_DIR LOCAL_STATE_DIR "/run/libvirt/network"
|
||||
#define NETWORK_STATE_DIR LOCAL_STATE_DIR "/lib/libvirt/network"
|
||||
#define NETWORK_PID_DIR LOCALSTATEDIR "/run/libvirt/network"
|
||||
#define NETWORK_STATE_DIR LOCALSTATEDIR "/lib/libvirt/network"
|
||||
|
||||
#define DNSMASQ_STATE_DIR LOCAL_STATE_DIR "/lib/libvirt/dnsmasq"
|
||||
#define DNSMASQ_STATE_DIR LOCALSTATEDIR "/lib/libvirt/dnsmasq"
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_NETWORK
|
||||
|
||||
@ -209,10 +210,10 @@ networkStartup(int privileged) {
|
||||
|
||||
if (privileged) {
|
||||
if (virAsprintf(&driverState->logDir,
|
||||
"%s/log/libvirt/qemu", LOCAL_STATE_DIR) == -1)
|
||||
"%s/log/libvirt/qemu", LOCALSTATEDIR) == -1)
|
||||
goto out_of_memory;
|
||||
|
||||
if ((base = strdup (SYSCONF_DIR "/libvirt")) == NULL)
|
||||
if ((base = strdup (SYSCONFDIR "/libvirt")) == NULL)
|
||||
goto out_of_memory;
|
||||
} else {
|
||||
char *userdir = virGetUserDirectory(uid);
|
||||
|
@ -2,7 +2,7 @@
|
||||
* nwfilter_driver.c: core driver for network filter APIs
|
||||
* (based on storage_driver.c)
|
||||
*
|
||||
* Copyright (C) 2006-2009 Red Hat, Inc.
|
||||
* Copyright (C) 2006-2010 Red Hat, Inc.
|
||||
* Copyright (C) 2006-2008 Daniel P. Berrange
|
||||
* Copyright (C) 2010 IBM Corporation
|
||||
* Copyright (C) 2010 Stefan Berger
|
||||
@ -37,7 +37,7 @@
|
||||
#include "nwfilter_conf.h"
|
||||
#include "nwfilter_driver.h"
|
||||
#include "nwfilter_gentech_driver.h"
|
||||
|
||||
#include "configmake.h"
|
||||
|
||||
#include "nwfilter_learnipaddr.h"
|
||||
|
||||
@ -83,7 +83,7 @@ nwfilterDriverStartup(int privileged) {
|
||||
nwfilterDriverLock(driverState);
|
||||
|
||||
if (privileged) {
|
||||
if ((base = strdup (SYSCONF_DIR "/libvirt")) == NULL)
|
||||
if ((base = strdup (SYSCONFDIR "/libvirt")) == NULL)
|
||||
goto out_of_memory;
|
||||
} else {
|
||||
uid_t uid = geteuid();
|
||||
|
@ -56,6 +56,7 @@
|
||||
#include "cpu/cpu.h"
|
||||
#include "domain_nwfilter.h"
|
||||
#include "files.h"
|
||||
#include "configmake.h"
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_QEMU
|
||||
|
||||
@ -112,7 +113,7 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
|
||||
virReportOOMError();
|
||||
return -1;
|
||||
}
|
||||
if (!(driver->vncTLSx509certdir = strdup(SYSCONF_DIR "/pki/libvirt-vnc"))) {
|
||||
if (!(driver->vncTLSx509certdir = strdup(SYSCONFDIR "/pki/libvirt-vnc"))) {
|
||||
virReportOOMError();
|
||||
return -1;
|
||||
}
|
||||
@ -121,7 +122,8 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
|
||||
virReportOOMError();
|
||||
return -1;
|
||||
}
|
||||
if (!(driver->spiceTLSx509certdir = strdup(SYSCONF_DIR "/pki/libvirt-spice"))) {
|
||||
if (!(driver->spiceTLSx509certdir
|
||||
= strdup(SYSCONFDIR "/pki/libvirt-spice"))) {
|
||||
virReportOOMError();
|
||||
return -1;
|
||||
}
|
||||
|
@ -84,7 +84,7 @@
|
||||
#include "virtaudit.h"
|
||||
#include "files.h"
|
||||
#include "fdstream.h"
|
||||
|
||||
#include "configmake.h"
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_QEMU
|
||||
|
||||
@ -1762,28 +1762,28 @@ qemudStartup(int privileged) {
|
||||
|
||||
if (privileged) {
|
||||
if (virAsprintf(&qemu_driver->logDir,
|
||||
"%s/log/libvirt/qemu", LOCAL_STATE_DIR) == -1)
|
||||
"%s/log/libvirt/qemu", LOCALSTATEDIR) == -1)
|
||||
goto out_of_memory;
|
||||
|
||||
if ((base = strdup (SYSCONF_DIR "/libvirt")) == NULL)
|
||||
if ((base = strdup (SYSCONFDIR "/libvirt")) == NULL)
|
||||
goto out_of_memory;
|
||||
|
||||
if (virAsprintf(&qemu_driver->stateDir,
|
||||
"%s/run/libvirt/qemu", LOCAL_STATE_DIR) == -1)
|
||||
"%s/run/libvirt/qemu", LOCALSTATEDIR) == -1)
|
||||
goto out_of_memory;
|
||||
|
||||
if (virAsprintf(&qemu_driver->libDir,
|
||||
"%s/lib/libvirt/qemu", LOCAL_STATE_DIR) == -1)
|
||||
"%s/lib/libvirt/qemu", LOCALSTATEDIR) == -1)
|
||||
goto out_of_memory;
|
||||
|
||||
if (virAsprintf(&qemu_driver->cacheDir,
|
||||
"%s/cache/libvirt/qemu", LOCAL_STATE_DIR) == -1)
|
||||
"%s/cache/libvirt/qemu", LOCALSTATEDIR) == -1)
|
||||
goto out_of_memory;
|
||||
if (virAsprintf(&qemu_driver->saveDir,
|
||||
"%s/lib/libvirt/qemu/save", LOCAL_STATE_DIR) == -1)
|
||||
"%s/lib/libvirt/qemu/save", LOCALSTATEDIR) == -1)
|
||||
goto out_of_memory;
|
||||
if (virAsprintf(&qemu_driver->snapshotDir,
|
||||
"%s/lib/libvirt/qemu/snapshot", LOCAL_STATE_DIR) == -1)
|
||||
"%s/lib/libvirt/qemu/snapshot", LOCALSTATEDIR) == -1)
|
||||
goto out_of_memory;
|
||||
} else {
|
||||
uid_t uid = geteuid();
|
||||
|
@ -2,7 +2,7 @@
|
||||
* remote_internal.h: driver to provide access to libvirtd running
|
||||
* on a remote machine
|
||||
*
|
||||
* Copyright (C) 2006-2007 Red Hat, Inc.
|
||||
* Copyright (C) 2006-2007, 2010 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -26,6 +26,8 @@
|
||||
|
||||
# include "libvirt/virterror.h"
|
||||
|
||||
# include "configmake.h"
|
||||
|
||||
int remoteRegister (void);
|
||||
|
||||
unsigned long remoteVersion(void);
|
||||
@ -33,13 +35,13 @@ unsigned long remoteVersion(void);
|
||||
# define LIBVIRTD_LISTEN_ADDR NULL
|
||||
# define LIBVIRTD_TLS_PORT "16514"
|
||||
# define LIBVIRTD_TCP_PORT "16509"
|
||||
# define LIBVIRTD_PRIV_UNIX_SOCKET LOCAL_STATE_DIR "/run/libvirt/libvirt-sock"
|
||||
# define LIBVIRTD_PRIV_UNIX_SOCKET_RO LOCAL_STATE_DIR "/run/libvirt/libvirt-sock-ro"
|
||||
# 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/libvirt-sock"
|
||||
# define LIBVIRTD_CONFIGURATION_FILE SYSCONF_DIR "/libvirtd.conf"
|
||||
# define LIBVIRTD_CONFIGURATION_FILE SYSCONFDIR "/libvirtd.conf"
|
||||
|
||||
/* Defaults for PKI directory. */
|
||||
# define LIBVIRT_PKI_DIR SYSCONF_DIR "/pki"
|
||||
# define LIBVIRT_PKI_DIR SYSCONFDIR "/pki"
|
||||
# define LIBVIRT_CACERT LIBVIRT_PKI_DIR "/CA/cacert.pem"
|
||||
# define LIBVIRT_CLIENTKEY LIBVIRT_PKI_DIR "/libvirt/private/clientkey.pem"
|
||||
# define LIBVIRT_CLIENTCERT LIBVIRT_PKI_DIR "/libvirt/clientcert.pem"
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include "uuid.h"
|
||||
#include "virterror_internal.h"
|
||||
#include "files.h"
|
||||
#include "configmake.h"
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_SECRET
|
||||
|
||||
@ -994,7 +995,7 @@ secretDriverStartup(int privileged)
|
||||
secretDriverLock(driverState);
|
||||
|
||||
if (privileged) {
|
||||
base = strdup(SYSCONF_DIR "/libvirt");
|
||||
base = strdup(SYSCONFDIR "/libvirt");
|
||||
if (base == NULL)
|
||||
goto out_of_memory;
|
||||
} else {
|
||||
|
@ -38,11 +38,12 @@
|
||||
#include "pci.h"
|
||||
#include "hostusb.h"
|
||||
#include "files.h"
|
||||
#include "configmake.h"
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_SECURITY
|
||||
#define SECURITY_APPARMOR_VOID_DOI "0"
|
||||
#define SECURITY_APPARMOR_NAME "apparmor"
|
||||
#define VIRT_AA_HELPER BINDIR "/virt-aa-helper"
|
||||
#define VIRT_AA_HELPER LIBEXECDIR "/virt-aa-helper"
|
||||
|
||||
/* Data structure to pass to *FileIterate so we have everything we need */
|
||||
struct SDPDOP {
|
||||
@ -561,7 +562,7 @@ AppArmorRestoreSecurityAllLabel(virSecurityDriverPtr drv ATTRIBUTE_UNUSED,
|
||||
}
|
||||
|
||||
/* Called via virExecWithHook. Output goes to
|
||||
* LOCAL_STATE_DIR/log/libvirt/qemu/<vm name>.log
|
||||
* LOCALSTATEDIR/log/libvirt/qemu/<vm name>.log
|
||||
*/
|
||||
static int
|
||||
AppArmorSetSecurityProcessLabel(virSecurityDriverPtr drv, virDomainObjPtr vm)
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "hostusb.h"
|
||||
#include "pci.h"
|
||||
#include "files.h"
|
||||
#include "configmake.h"
|
||||
|
||||
static char *progname;
|
||||
|
||||
@ -1179,11 +1180,11 @@ main(int argc, char **argv)
|
||||
goto clean;
|
||||
} else {
|
||||
virBufferVSprintf(&buf, " \"%s/log/libvirt/**/%s.log\" w,\n",
|
||||
LOCAL_STATE_DIR, ctl->def->name);
|
||||
LOCALSTATEDIR, ctl->def->name);
|
||||
virBufferVSprintf(&buf, " \"%s/lib/libvirt/**/%s.monitor\" rw,\n",
|
||||
LOCAL_STATE_DIR, ctl->def->name);
|
||||
LOCALSTATEDIR, ctl->def->name);
|
||||
virBufferVSprintf(&buf, " \"%s/run/libvirt/**/%s.pid\" rwk,\n",
|
||||
LOCAL_STATE_DIR, ctl->def->name);
|
||||
LOCALSTATEDIR, ctl->def->name);
|
||||
if (ctl->files)
|
||||
virBufferVSprintf(&buf, "%s", ctl->files);
|
||||
}
|
||||
|
@ -31,10 +31,11 @@
|
||||
#include "storage_backend_disk.h"
|
||||
#include "util.h"
|
||||
#include "memory.h"
|
||||
#include "configmake.h"
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_STORAGE
|
||||
|
||||
#define PARTHELPER BINDIR "/libvirt_parthelper"
|
||||
#define PARTHELPER LIBEXECDIR "/libvirt_parthelper"
|
||||
|
||||
#define SECTOR_SIZE 512
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* storage_driver.c: core driver for storage APIs
|
||||
*
|
||||
* Copyright (C) 2006-2009 Red Hat, Inc.
|
||||
* Copyright (C) 2006-2010 Red Hat, Inc.
|
||||
* Copyright (C) 2006-2008 Daniel P. Berrange
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
@ -46,6 +46,7 @@
|
||||
#include "storage_backend.h"
|
||||
#include "logging.h"
|
||||
#include "files.h"
|
||||
#include "configmake.h"
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_STORAGE
|
||||
|
||||
@ -125,7 +126,7 @@ storageDriverStartup(int privileged) {
|
||||
storageDriverLock(driverState);
|
||||
|
||||
if (privileged) {
|
||||
if ((base = strdup (SYSCONF_DIR "/libvirt")) == NULL)
|
||||
if ((base = strdup (SYSCONFDIR "/libvirt")) == NULL)
|
||||
goto out_of_memory;
|
||||
} else {
|
||||
uid_t uid = geteuid();
|
||||
|
@ -61,11 +61,12 @@
|
||||
#include "domain_nwfilter.h"
|
||||
#include "files.h"
|
||||
#include "fdstream.h"
|
||||
#include "configmake.h"
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_UML
|
||||
|
||||
/* For storing short-lived temporary files. */
|
||||
#define TEMPDIR LOCAL_STATE_DIR "/cache/libvirt"
|
||||
#define TEMPDIR LOCALSTATEDIR "/cache/libvirt"
|
||||
|
||||
typedef struct _umlDomainObjPrivate umlDomainObjPrivate;
|
||||
typedef umlDomainObjPrivate *umlDomainObjPrivatePtr;
|
||||
@ -371,14 +372,14 @@ umlStartup(int privileged) {
|
||||
|
||||
if (privileged) {
|
||||
if (virAsprintf(¨_driver->logDir,
|
||||
"%s/log/libvirt/uml", LOCAL_STATE_DIR) == -1)
|
||||
"%s/log/libvirt/uml", LOCALSTATEDIR) == -1)
|
||||
goto out_of_memory;
|
||||
|
||||
if ((base = strdup (SYSCONF_DIR "/libvirt")) == NULL)
|
||||
if ((base = strdup (SYSCONFDIR "/libvirt")) == NULL)
|
||||
goto out_of_memory;
|
||||
|
||||
if (virAsprintf(¨_driver->monitorDir,
|
||||
"%s/run/libvirt/uml-guest", LOCAL_STATE_DIR) == -1)
|
||||
"%s/run/libvirt/uml-guest", LOCALSTATEDIR) == -1)
|
||||
goto out_of_memory;
|
||||
} else {
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "logging.h"
|
||||
#include "memory.h"
|
||||
#include "files.h"
|
||||
#include "configmake.h"
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_HOOK
|
||||
|
||||
@ -44,7 +45,7 @@
|
||||
virReportErrorHelper(NULL, VIR_FROM_HOOK, code, __FILE__, \
|
||||
__FUNCTION__, __LINE__, __VA_ARGS__)
|
||||
|
||||
#define LIBVIRT_HOOK_DIR SYSCONF_DIR "/libvirt/hooks"
|
||||
#define LIBVIRT_HOOK_DIR SYSCONFDIR "/libvirt/hooks"
|
||||
|
||||
VIR_ENUM_DECL(virHookDriver)
|
||||
VIR_ENUM_DECL(virHookDaemonOp)
|
||||
|
@ -17,7 +17,6 @@ INCLUDES = \
|
||||
$(SASL_CFLAGS) \
|
||||
$(SELINUX_CFLAGS) \
|
||||
$(APPARMOR_CFLAGS) \
|
||||
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
|
||||
$(COVERAGE_CFLAGS) \
|
||||
$(WARN_CFLAGS)
|
||||
|
||||
|
@ -55,8 +55,6 @@ virsh_CFLAGS = \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_srcdir)/src/util \
|
||||
-I$(top_srcdir) \
|
||||
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
|
||||
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
|
||||
$(WARN_CFLAGS) \
|
||||
$(COVERAGE_CFLAGS) \
|
||||
$(LIBXML_CFLAGS) \
|
||||
|
@ -53,6 +53,7 @@
|
||||
#include "libvirt/libvirt-qemu.h"
|
||||
#include "files.h"
|
||||
#include "../daemon/event.h"
|
||||
#include "configmake.h"
|
||||
|
||||
static char *progname;
|
||||
|
||||
@ -11786,11 +11787,11 @@ main(int argc, char **argv)
|
||||
perror("setlocale");
|
||||
/* failure to setup locale is not fatal */
|
||||
}
|
||||
if (!bindtextdomain(GETTEXT_PACKAGE, LOCALEBASEDIR)) {
|
||||
if (!bindtextdomain(PACKAGE, LOCALEDIR)) {
|
||||
perror("bindtextdomain");
|
||||
return -1;
|
||||
}
|
||||
if (!textdomain(GETTEXT_PACKAGE)) {
|
||||
if (!textdomain(PACKAGE)) {
|
||||
perror("textdomain");
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user