* 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.
canonicalize-lgpl
close
connect
+configmake
count-one-bits
crypto/md5
dirname-lgpl
-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) \
#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 */
/* 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();
%s\n\
\n"),
argv0,
- SYSCONF_DIR,
- LOCAL_STATE_DIR,
- LOCAL_STATE_DIR,
+ SYSCONFDIR,
+ LOCALSTATEDIR,
+ LOCALSTATEDIR,
LIBVIRT_CACERT,
LIBVIRT_SERVERCERT,
LIBVIRT_SERVERKEY,
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
/* 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) {
<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
-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 \
/*
* 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
#include "memory.h"
#include "cpu.h"
#include "cpu_map.h"
-
+#include "configmake.h"
#define VIR_FROM_THIS VIR_FROM_CPU
/*
* 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
#include "memory.h"
#include "logging.h"
#include "util.h"
+#include "configmake.h"
#define DEFAULT_DRIVER_DIR LIBDIR "/libvirt/drivers"
# 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. */
#include "uuid.h"
#include "util.h"
#include "memory.h"
+#include "configmake.h"
#ifndef WITH_DRIVER_MODULES
# ifdef WITH_TEST
if (winsock_init () == -1) return -1;
#endif
- if (!bindtextdomain(GETTEXT_PACKAGE, LOCALEBASEDIR))
+ if (!bindtextdomain(PACKAGE, LOCALEDIR))
return (-1);
/*
/*
+ * Copyright (C) 2010 Red Hat, Inc.
* Copyright IBM Corp. 2008
*
* lxc_conf.c: config functions for managing linux containers
#include "memory.h"
#include "logging.h"
#include "uuid.h"
-
+#include "configmake.h"
#define VIR_FROM_THIS VIR_FROM_LXC
"exe",
utsname.machine,
sizeof(int) == 4 ? 32 : 8,
- BINDIR "/libvirt_lxc",
+ LIBEXECDIR "/libvirt_lxc",
NULL,
0,
NULL)) == NULL)
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. */
# 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;
#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
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);
* 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
#include "nwfilter_conf.h"
#include "nwfilter_driver.h"
#include "nwfilter_gentech_driver.h"
-
+#include "configmake.h"
#include "nwfilter_learnipaddr.h"
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();
#include "cpu/cpu.h"
#include "domain_nwfilter.h"
#include "files.h"
+#include "configmake.h"
#define VIR_FROM_THIS VIR_FROM_QEMU
virReportOOMError();
return -1;
}
- if (!(driver->vncTLSx509certdir = strdup(SYSCONF_DIR "/pki/libvirt-vnc"))) {
+ if (!(driver->vncTLSx509certdir = strdup(SYSCONFDIR "/pki/libvirt-vnc"))) {
virReportOOMError();
return -1;
}
virReportOOMError();
return -1;
}
- if (!(driver->spiceTLSx509certdir = strdup(SYSCONF_DIR "/pki/libvirt-spice"))) {
+ if (!(driver->spiceTLSx509certdir
+ = strdup(SYSCONFDIR "/pki/libvirt-spice"))) {
virReportOOMError();
return -1;
}
#include "virtaudit.h"
#include "files.h"
#include "fdstream.h"
-
+#include "configmake.h"
#define VIR_FROM_THIS VIR_FROM_QEMU
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();
* 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
# include "libvirt/virterror.h"
+# include "configmake.h"
+
int remoteRegister (void);
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"
#include "uuid.h"
#include "virterror_internal.h"
#include "files.h"
+#include "configmake.h"
#define VIR_FROM_THIS VIR_FROM_SECRET
secretDriverLock(driverState);
if (privileged) {
- base = strdup(SYSCONF_DIR "/libvirt");
+ base = strdup(SYSCONFDIR "/libvirt");
if (base == NULL)
goto out_of_memory;
} else {
#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 {
}
/* 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)
#include "hostusb.h"
#include "pci.h"
#include "files.h"
+#include "configmake.h"
static char *progname;
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);
}
#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
/*
* 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
#include "storage_backend.h"
#include "logging.h"
#include "files.h"
+#include "configmake.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
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();
#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;
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 {
#include "logging.h"
#include "memory.h"
#include "files.h"
+#include "configmake.h"
#define VIR_FROM_THIS VIR_FROM_HOOK
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)
$(SASL_CFLAGS) \
$(SELINUX_CFLAGS) \
$(APPARMOR_CFLAGS) \
- -DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
$(COVERAGE_CFLAGS) \
$(WARN_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) \
#include "libvirt/libvirt-qemu.h"
#include "files.h"
#include "../daemon/event.h"
+#include "configmake.h"
static char *progname;
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;
}