From 0d5f54bb2158528c603d34b29e0faab9ca23a93b Mon Sep 17 00:00:00 2001
From: Eric Blake The libvirt hook scripts are located in the directory
- Script location
$SYSCONF_DIR/libvirt/hooks/
.$SYSCONFDIR/libvirt/hooks/
.
/etc/libvirt/hooks/
. Other Linux distributions may do
diff --git a/src/Makefile.am b/src/Makefile.am
index 20c0c9f4a7..a9a1986c6d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -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 \
diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c
index 263bb9e93e..0c5ff8a421 100644
--- a/src/cpu/cpu_map.c
+++ b/src/cpu/cpu_map.c
@@ -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
diff --git a/src/driver.c b/src/driver.c
index a6f55580ab..d83b1fddfa 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -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"
diff --git a/src/internal.h b/src/internal.h
index fab3e111cc..a98daa3180 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -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. */
diff --git a/src/libvirt.c b/src/libvirt.c
index 3c8bf30a3d..eba0deee59 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -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);
/*
diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c
index f4479e68ed..59d1161916 100644
--- a/src/lxc/lxc_conf.c
+++ b/src/lxc/lxc_conf.c
@@ -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. */
diff --git a/src/lxc/lxc_conf.h b/src/lxc/lxc_conf.h
index e4c2c528cd..f820d6dd60 100644
--- a/src/lxc/lxc_conf.h
+++ b/src/lxc/lxc_conf.h
@@ -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;
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 631fbf1f68..54890f93cb 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -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);
diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
index 4efeb3a23c..a305de63ea 100644
--- a/src/nwfilter/nwfilter_driver.c
+++ b/src/nwfilter/nwfilter_driver.c
@@ -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();
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 83a117aade..35caccc81b 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -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;
}
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 449534aeb6..ed1ea6b715 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -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();
diff --git a/src/remote/remote_driver.h b/src/remote/remote_driver.h
index 49a63bd4a1..1504eecc63 100644
--- a/src/remote/remote_driver.h
+++ b/src/remote/remote_driver.h
@@ -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"
diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
index 2b5a7c6e75..c5a876bed1 100644
--- a/src/secret/secret_driver.c
+++ b/src/secret/secret_driver.c
@@ -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 {
diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
index be39f758fc..b43c4ac0f8 100644
--- a/src/security/security_apparmor.c
+++ b/src/security/security_apparmor.c
@@ -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/