[libvirt] [PATCH 0/2] Support the QED disk image format
by Adam Litke
Qemu is about to gain support for a new disk image format: QED. Details on
this format (including specification) can be found here:
http://wiki.qemu.org/Features/QED. This short series of patches allows QED
images to be used with libvirt.
Adam Litke (2):
QED: Basic support for QED images
Support for probing qed image metadata
src/util/storage_file.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++-
src/util/storage_file.h | 1 +
2 files changed, 85 insertions(+), 1 deletions(-)
--
1.7.3.2.164.g6f10c
14 years, 1 month
[libvirt] [PATCH] virsh: tell if domain is updated in dominfo
by Osier Yang
* tools/virsh.c (introduce new information 'Updated' for 'dominfo',
standsfor if a domain is updated via operations like 'update-device',
'update-disk', etc.)
---
tools/virsh.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index ae88cc0..d260443 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -1992,6 +1992,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
virSecurityModel secmodel;
virSecurityLabel seclabel;
int persistent = 0;
+ int updated = -1;
int ret = TRUE, autostart;
unsigned int id;
char *str, uuid[VIR_UUID_STRING_BUFLEN];
@@ -2053,6 +2054,12 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
else
vshPrint(ctl, "%-15s %s\n", _("Persistent:"), persistent ? _("yes") : _("no"));
+ updated = virDomainIsUpdated(dom);
+ if (updated < 0)
+ vshPrint(ctl, "%-15s %s\n", _("Updated:"), _("unknown"));
+ else
+ vshPrint(ctl, "%-15s %s\n", _("Updated:"), updated ? _("yes") : _("no"));
+
/* Check and display whether the domain autostarts or not */
if (!virDomainGetAutostart(dom, &autostart)) {
vshPrint(ctl, "%-15s %s\n", _("Autostart:"),
--
1.7.3.2
14 years, 1 month
[libvirt] polkit auth issue
by Jim Fehlig
I'm trying to debug a PolicyKit auth issue in libvirt and looking for
some suggestions.
Server has the following policy for user ski52 in
/etc/PolicyKit/PolicyKit.conf :
<match action="org.libvirt.unix.manage">
<match user="ski52">
<return result="auth_self_keep_always"/>
</match>
</match>
I can authenticate via polkit when logged directly into server via ssh
as ski52
ski52@vhost52:~> virsh -c qemu:///system list
Attempting to obtain authorization for org.libvirt.unix.manage.
Authentication is required.
Password:
Successfully obtained the authorization for org.libvirt.unix.manage.
Id Name State
----------------------------------
33 vm1 running
But when using qemu+ssh remotely
ski53@vhost53:~> virsh -c qemu+ssh://ski52@vhost52/system list
Attempting to obtain authorization for org.libvirt.unix.manage.
Authentication as an administrative user is required.
Password:
polkit-grant-helper-pam: pam_authenticated failed: Authentication failure
Failed to obtain authorization for org.libvirt.unix.manage.
error: authentication failed
error: failed to connect to the hypervisor
AFAICT by tracing with gdb, the client calls polkit-auth *locally* when
authentication is needed, instead of invoking polkit-auth on the
server. This backtrace from gdb on the client machine shows
'polkit-auth --obtain' being called locally from virConnectAuthGainPolkit()
#0 virConnectAuthGainPolkit (privilege=0x7ffff7b8b3ba
"org.libvirt.unix.manage") at libvirt.c:111
#1 0x00007ffff7a912a3 in virConnectAuthCallbackDefault
(cred=0x7fffffffdd20, ncred=1, cbdata=0x0)
at libvirt.c:149
#2 0x00007ffff7ac367f in remoteAuthPolkit (conn=0x63ec10,
priv=0x7ffff7e25010, in_open=1,
auth=0x7ffff7dc9bc0) at remote/remote_driver.c:7431
#3 0x00007ffff7ac1d8d in remoteAuthenticate (conn=0x63ec10,
priv=0x7ffff7e25010, in_open=1,
auth=0x7ffff7dc9bc0, authtype=0x0) at remote/remote_driver.c:6864
#4 0x00007ffff7ab5936 in doRemoteOpen (conn=0x63ec10,
priv=0x7ffff7e25010, auth=0x7ffff7dc9bc0, flags=0)
at remote/remote_driver.c:854
..
Has anyone else observed such behavior? Any hints on how to forward the
polkit-auth call to the server? Both client and server are libvirt
0.8.5 btw.
Regards,
Jim
14 years, 1 month
[libvirt] VMware Workstation/Player support
by Jean-Baptiste Rouault
Hi all,
I'm working on the hynesim project (http://www.hynesim.org
http://blog.hynesim.org).
We are going to add VMware Workstation support to hynesim,
so we would like to contribute to the development of a libvirt driver.
There probably are multiple ways of doing this, one of them could
be to use the VIX C API provided by VMware :
http://www.vmware.com/support/developer/vix-api/
However, the VIX license seems to be quite restrictive :
http://www.vmware.com/download/eula/vixapi_eula.html
I'm not a license expert so I don't know if this license forbids
using the API in software like libvirt.
Another possibility could be to run VMware command line tools
from libvirt to control guests.
As Daniel P. Berrange stated on IRC yesterday, the vmx <-> XML
conversion code can be reused from the ESX driver.
I'd like to have your opinion about the "best" to implement this
VMware Workstation driver.
Regards,
Jean-Baptiste Rouault
14 years, 1 month
[libvirt] [PATCH] virt-aa-helper: Fix several compile errors
by Matthias Bolte
Include locale.h for setlocale().
Revert the usage string back to it's original form.
Use puts() instead of fputs(), as fputs() expects a FILE*.
Add closing parenthesis to some vah_error() calls.
Use argv[0] instead of an undefined argv0.
---
src/security/virt-aa-helper.c | 39 ++++++++++++++++++++-------------------
1 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 12adbbb..41bc598 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -26,6 +26,7 @@
#include <getopt.h>
#include <stdbool.h>
#include <sys/utsname.h>
+#include <locale.h>
#include "internal.h"
#include "buf.h"
@@ -84,21 +85,21 @@ vahDeinit(vahControl * ctl)
static void
vah_usage(void)
{
- fprintf(stdout, _("\n%s [options] [< def.xml]\n\n
- Options:\n
- -a | --add load profile\n
- -c | --create create profile from template\n
- -D | --delete unload and delete profile\n
- -f | --add-file <file> add file to profile\n
- -F | --append-file <file> append file to profile\n
- -r | --replace reload profile\n
- -R | --remove unload profile\n
- -h | --help this help\n
- -u | --uuid <uuid> uuid (profile name)\n
-\n", progname);
-
- fputs(_("This command is intended to be used by libvirtd "
- "and not used directly.\n"));
+ printf(_("\n%s [options] [< def.xml]\n\n"
+ " Options:\n"
+ " -a | --add load profile\n"
+ " -c | --create create profile from template\n"
+ " -D | --delete unload and delete profile\n"
+ " -f | --add-file <file> add file to profile\n"
+ " -F | --append-file <file> append file to profile\n"
+ " -r | --replace reload profile\n"
+ " -R | --remove unload profile\n"
+ " -h | --help this help\n"
+ " -u | --uuid <uuid> uuid (profile name)\n"
+ "\n"), progname);
+
+ puts(_("This command is intended to be used by libvirtd "
+ "and not used directly.\n"));
return;
}
@@ -289,7 +290,7 @@ update_include_file(const char *include_file, const char *included_files,
}
if (VIR_CLOSE(fd) != 0) {
- vah_error(NULL, 0, _("failed to close or write to profile")_;
+ vah_error(NULL, 0, _("failed to close or write to profile"));
goto clean;
}
rc = 0;
@@ -396,7 +397,7 @@ create_profile(const char *profile, const char *profile_name,
}
if (VIR_CLOSE(fd) != 0) {
- vah_error(NULL, 0, _("failed to close or write to profile")_;
+ vah_error(NULL, 0, _("failed to close or write to profile"));
goto clean_all;
}
rc = 0;
@@ -1061,7 +1062,7 @@ vahParseArgv(vahControl * ctl, int argc, char **argv)
case 'f':
case 'F':
if ((ctl->newfile = strdup(optarg)) == NULL)
- vah_error(ctl, 1, _("could not allocate memory for disk")_;
+ vah_error(ctl, 1, _("could not allocate memory for disk"));
ctl->append = arg == 'F';
break;
case 'h':
@@ -1140,7 +1141,7 @@ main(int argc, char **argv)
if (setlocale(LC_ALL, "") == NULL ||
bindtextdomain(PACKAGE, LOCALEDIR) == NULL ||
textdomain(PACKAGE) == NULL) {
- fprintf(stderr, _("%s: initialization failed\n"), argv0);
+ fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
exit(EXIT_FAILURE);
}
--
1.7.0.4
14 years, 1 month
[libvirt] [PATCH 0/6] [RFC] Add disk streaming support to libvirt
by Adam Litke
( Those on Cc: sorry for any duplicated messages. git was configured to use
the wrong smtp relay )
I've been working with Anthony Liguori and Stefan Hajnoczi to enable data
streaming to copy-on-read disk images in qemu. This work is working its way
through review and I expect it to be upstream soon as part of the support for
the new QED disk image format.
Disk streaming is extremely useful when provisioning domains from a central
repository of template images. Currently the domain must be provisioned by
either: 1) copying the template image to local storage before the VM can be
started or, 2) creating a qcow2 image that backs to a base image in the remote
repository. Option 1 can introduce a significant delay when provisioning large
disks. Option 2 introduces a permanent dependency on a remote service,
increased network load to satisfy disk reads.
Device streaming provides the "instant-on" benefits of option 2 without
introducing a permanent dependency to the image repository. Once the VM is
started, the contents of the disk can be streamed to the local image in
parallel. Once streaming is finished, the domain has a complete and coherent
copy of the image and no longer depends on the central image repository.
Qemu will support two streaming modes: full device and single sector. Full
device streaming is the easiest to use because one command will cause the whole
device to be streamed as fast as possible. Single sector mode can be used if
one wants to throttle streaming to reduce I/O pressure. In this mode, a
management tool issues individual commands to stream single sectors.
To enable this support in libvirt, I propose the following API...
virDomainStreamDisk() will start or stop a full device stream or stream a
single sector of a device. The behavior is controlled by setting
virDomainStreamDiskFlags. When either starting or stopping a full device
stream, the return value is either 0 or -1 to indicate whether the operation
succeeded. For a single sector stream, a device offset is returned (or -1 on
failure). This value can be used to continue streaming with a subsequent call
to virDomainStreamDisk().
virDomainStreamDiskInfo() returns information about active full device streams
(the device alias, current streaming position, and total size).
While streaming can be used to enable live block migration, this API addresses
the direct streaming use case. If we can agree that the above use case is
compelling on its own, I would prefer to work on the block migration workflow
immediately after this series. In that case, we just need to be careful not to
paint ourselves into a corner with respect to migration, but specifics about
that feature can be discussed later. Does this seem reasonable?
Adam Litke (6):
Add new API virDomainStreamDisk[Info] to header and drivers
virDomainStreamDisk: Add public symbols to libvirt API
Implement disk streaming in the qemu driver
Add disk streaming support to the remote driver
Add new disk streaming commands to virsh
python: Add python bindings for virDomainStreamDisk[Info]
daemon/remote.c | 96 +++++++++++++++++++++
daemon/remote_dispatch_args.h | 2 +
daemon/remote_dispatch_prototypes.h | 16 ++++
daemon/remote_dispatch_ret.h | 2 +
daemon/remote_dispatch_table.h | 10 ++
include/libvirt/libvirt.h.in | 34 ++++++++
python/generator.py | 1 +
python/libvirt-override-api.xml | 5 +
python/libvirt-override.c | 46 ++++++++++
src/driver.h | 11 +++
src/esx/esx_driver.c | 2 +
src/libvirt.c | 121 +++++++++++++++++++++++++++
src/libvirt_public.syms | 6 ++
src/lxc/lxc_driver.c | 2 +
src/opennebula/one_driver.c | 2 +
src/openvz/openvz_driver.c | 2 +
src/phyp/phyp_driver.c | 2 +
src/qemu/qemu_driver.c | 75 +++++++++++++++++
src/qemu/qemu_monitor.c | 41 +++++++++
src/qemu/qemu_monitor.h | 6 ++
src/qemu/qemu_monitor_json.c | 104 +++++++++++++++++++++++
src/qemu/qemu_monitor_json.h | 7 ++
src/qemu/qemu_monitor_text.c | 156 ++++++++++++++++++++++++++++++++++
src/qemu/qemu_monitor_text.h | 8 ++
src/remote/remote_driver.c | 85 +++++++++++++++++++
src/remote/remote_protocol.c | 63 ++++++++++++++
src/remote/remote_protocol.h | 51 +++++++++++
src/remote/remote_protocol.x | 37 ++++++++-
src/test/test_driver.c | 2 +
src/uml/uml_driver.c | 2 +
src/vbox/vbox_tmpl.c | 2 +
src/xen/xen_driver.c | 2 +
tools/virsh.c | 157 +++++++++++++++++++++++++++++++++++
33 files changed, 1157 insertions(+), 1 deletions(-)
--
1.7.3.2.164.g6f10c
14 years, 1 month
[libvirt] [PATCH] build: fix autobuild failures on gcov upgrade
by Eric Blake
* autobuild.sh: Avoid syntax error on failed test.
* tools/Makefile.am (CLEANFILES): Clean coverage files.
---
Pushing under the build-breaker rule. Last time I ran ./autobuild.sh
was on F13; and upgrading to F14 exposed these leftovers due to a
newer gcov than what was in the stale files, in the form of spurious
messages that break 'make check':
+profiling:/home/remote/eblake/libvirt-tmp/tools/virsh-console.gcda:Version mismatch - expected 405R got 404R
and concluding with a bug in the autobuild.sh script itself:
./autobuild.sh: line 44: test: =: unary operator expected
autobuild.sh | 2 +-
tools/Makefile.am | 1 +
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/autobuild.sh b/autobuild.sh
index 130f72d..8248a59 100755
--- a/autobuild.sh
+++ b/autobuild.sh
@@ -41,7 +41,7 @@ st=$(
{ make check syntax-check 2>&1; echo $? >&4; } | tee "$RESULTS"
)
exec 3>&-
-test $st = 0
+test "$st" = 0
test -x /usr/bin/lcov && make cov
rm -f *.tar.gz
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 376ffa8..8a5fb52 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -160,5 +160,6 @@ endif # LIBVIRT_INIT_SCRIPT_RED_HAT
CLEANFILES = $(bin_SCRIPTS) $(man1_MANS)
+CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES = $(BUILT_SOURCES)
--
1.7.3.2
14 years, 1 month
[libvirt] [PATCH] docs: added compiling page and significantly expanded windows page
by Justin Clift
Also added an additional menu placement for the windows page, in
order to attract further potential testers.
---
docs/compiling.html.in | 48 ++++++++++++++++++++++++
docs/downloads.html.in | 41 +--------------------
docs/sitemap.html.in | 10 +++++
docs/windows.html.in | 95 +++++++++++++++++++++++++++++++++++++++++-------
4 files changed, 142 insertions(+), 52 deletions(-)
create mode 100644 docs/compiling.html.in
diff --git a/docs/compiling.html.in b/docs/compiling.html.in
new file mode 100644
index 0000000..471f52d
--- /dev/null
+++ b/docs/compiling.html.in
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<html>
+ <body>
+ <h1><a name="installation">libvirt Installation</a></h1>
+
+ <ul id="toc"></ul>
+
+ <h2><a name="Compilatio">Compiling a release tarball</a></h2>
+
+ <p>
+ libvirt uses the standard configure/make/install steps:
+ </p>
+
+ <pre>
+ gunzip -c libvirt-xxx.tar.gz | tar xvf -
+ cd libvirt-xxxx
+ ./configure --help</pre>
+
+ <p>
+ To see the options, then the compilation/installation proper:
+ </p>
+
+ <pre>
+ ./configure [possible options]
+ make
+ make install</pre>
+
+ <p>
+ At that point you may have to rerun ldconfig or a similar utility to
+ update your list of installed shared libs.
+ </p>
+
+ <h2><a name="build">Building from a GIT checkout</a></h2>
+
+ <p>
+ The libvirt build process uses GNU autotools, so after obtaining a
+ checkout it is necessary to generate the configure script and Makefile.in
+ templates using the <code>autogen.sh</code> command, passing the extra
+ arguments as for configure. As an example, to do a complete build and
+ install it into your home directory run:
+ </p>
+
+ <pre>
+ ./autogen.sh --prefix=$HOME/usr --enable-compile-warnings=error
+ make
+ make install</pre>
+ </body>
+</html>
diff --git a/docs/downloads.html.in b/docs/downloads.html.in
index 709bee8..64a16c9 100644
--- a/docs/downloads.html.in
+++ b/docs/downloads.html.in
@@ -91,46 +91,9 @@
<br />
- <h1><a name="installation">libvirt Installation</a></h1>
-
- <h2><a name="Compilatio">Compiling a release tarball</a></h2>
-
- <p>
- libvirt uses the standard configure/make/install steps:
- </p>
-
- <pre>
- gunzip -c libvirt-xxx.tar.gz | tar xvf -
- cd libvirt-xxxx
- ./configure --help</pre>
-
- <p>
- To see the options, then the compilation/installation proper:
- </p>
-
- <pre>
- ./configure [possible options]
- make
- make install</pre>
-
<p>
- At that point you may have to rerun ldconfig or a similar utility to
- update your list of installed shared libs.
+ Once you've have obtained the libvirt source code, you can compile it
+ using the <a href="compiling.html">instructions here</a>.
</p>
-
- <h2><a name="build">Building from a GIT checkout</a></h2>
-
- <p>
- The libvirt build process uses GNU autotools, so after obtaining a
- checkout it is necessary to generate the configure script and Makefile.in
- templates using the <code>autogen.sh</code> command, passing the extra
- arguments as for configure. As an example, to do a complete build and
- install it into your home directory run:
- </p>
-
- <pre>
- ./autogen.sh --prefix=$HOME/usr --enable-compile-warnings=error
- make
- make install</pre>
</body>
</html>
diff --git a/docs/sitemap.html.in b/docs/sitemap.html.in
index 692da29..bd39e10 100644
--- a/docs/sitemap.html.in
+++ b/docs/sitemap.html.in
@@ -21,12 +21,22 @@
<li>
<a href="downloads.html">Downloads</a>
<span>Get the latest source releases, binary builds and get access to the source repository</span>
+ <ul>
+ <li>
+ <a href="windows.html">Windows</a>
+ <span>Downloads for Windows</span>
+ </li>
+ </ul>
</li>
<li>
<a href="docs.html">Documentation</a>
<span>Information for users, administrators and developers</span>
<ul>
<li>
+ <a href="compiling.html">Compiling</a>
+ <span>How to compile libvirt</span>
+ </li>
+ <li>
<a href="deployment.html">Deployment</a>
<span>Information about deploying and using libvirt</span>
<ul>
diff --git a/docs/windows.html.in b/docs/windows.html.in
index 8ca6b0d..f973d76 100644
--- a/docs/windows.html.in
+++ b/docs/windows.html.in
@@ -3,20 +3,93 @@
<body>
<h1 >Windows support</h1>
+ <ul id="toc"></ul>
+
+ <p>
+ Libvirt is known to work as a client (not server) on Windows XP
+ (32-bit), Windows 7 (64-bit), and other Windows variants.
+ </p>
+
+ <h2><a name="installer">Experimental installation package</a></h2>
+
+ <p>
+ A windows installation package is in development. An experimental
+ first version is available here:
+ </p>
+
+ <a href="http://libvirt.org/sources/win32_experimental/Libvirt-0.8.5-0.exe">http://libvirt.org/sources/win32_experimental/Libvirt-0.8.5-0.exe</a>
+
<p>
- Libvirt can be compiled on Windows
- using the free <a href="http://www.mingw.org/">MinGW compiler</a>.
- You can also cross-compile to a Windows target
- from a Fedora machine using the packages available
- <a href="http://hg.et.redhat.com/misc/fedora-mingw--devel/">from
- the Fedora MinGW project</a>
+ <b>It is not production ready.</b>
+ </p>
+
+ <p>
+ This version includes the libvirt development headers and libraries
+ for compiling against, the virsh shell with it's needed dependencies,
+ and untested Python bindings.
+ </p>
+
+ <h3><a name="caveats">Caveats</h3>
+
+ <ul>
+ <li>
+ This installer just repackages the files compiled using Matthias
+ Bolte's msys_setup scripting (described below).
+ </li>
+ <li>
+ This is a .exe installer, created using NSIS. We're looking into
+ something to create .msi installers as well.
+ </li>
+ <li>
+ The working connection types at the moment are very limited. Only
+ <b>qemu+tcp://</b> is known to work for sure. Anything using SSH,
+ such as <b>qemu+ssh://</b>, definitely doesn't work. Connecting
+ to ESX servers doesn't yet work either, due to a bug involving
+ GnuTLS, which should be fixed in the next release.
+ </li>
+ <li>
+ The script for the NSIS installer is available online
+ <a href="https://github.com/justinclift/nsis_libvirt_installer">here</a>.
+ </li>
+ </ul>
+
+ <h3><a name="feedback">Feedback</h3>
+
+ <p>
+ Feedback and suggestions on changes to make and what else to include
+ <a href="contact.html">are desired</a>.
+
+ <h2><a name="compiling">Compiling yourself</a></h2>
+
+ <p>
+ Libvirt can be compiled on Windows using the free
+ <a href="http://www.mingw.org/">MinGW compiler</a>.
+ </p>
+
+ <h3><a name="msys_setup">MSYS Build script</a></h3>
+
+ <p>
+ The easiest way is to use the <b>msys_setup</b> script, developed by
+ Matthias Bolte. This is actively developed and kept current with
+ libvirt releases:
+ </p>
+
+ <a href="https://github.com/photron/msys_setup">https://github.com/photron/msys_setup</a>
+
+ <h3><a name="cross-compile">Cross compiling</a></h3>
+
+ <p>
+ You can also cross-compile to a Windows target from a Fedora machine
+ using the packages available
+ <a href="http://hg.et.redhat.com/misc/fedora-mingw--devel/">from the Fedora MinGW project</a>
(which includes a working libvirt specfile).
</p>
+ <h3><a name="configure">By hand</a></h3>
+
<p>
- Libvirt can only be built as a client on Windows
- allowing remote access to systems libvirt servers.
- Configure libvirt like this:
+ Use these options when following the instructions on the
+ <a href="compiling.html">Compiling</a> page.
</p>
<pre>
@@ -32,9 +105,5 @@
--without-libvirtd
</pre>
- <p>
- We intend to supply Windows binaries on this page
- later, but at the moment you have to compile from source.
- </p>
</body>
</html>
--
1.7.3
14 years, 1 month
[libvirt] [PATCH] maint: use gnulib configmake rather than open-coding things
by Eric Blake
In some cases, we were just plain confusing (BINDIR expanded to
$(libexecdir), GETTEXT_PACKAGE redefined PACKAGE for no apparant
reason); in other cases, we might as well benefit from gnulib doing
the work for us (PKGDATADIR), sometimes with different spellings
(LOCAL_STATE_DIR vs. LOCALSTATEDIR).
* 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.
---
bootstrap.conf | 1 +
daemon/Makefile.am | 6 ++----
daemon/libvirtd.c | 14 ++++++++------
docs/hooks.html.in | 2 +-
src/Makefile.am | 8 --------
src/cpu/cpu_map.c | 4 ++--
src/driver.c | 3 ++-
src/internal.h | 2 +-
src/libvirt.c | 3 ++-
src/lxc/lxc_conf.c | 7 ++++---
src/lxc/lxc_conf.h | 7 ++++---
src/network/bridge_driver.c | 11 ++++++-----
src/nwfilter/nwfilter_driver.c | 6 +++---
src/qemu/qemu_conf.c | 6 ++++--
src/qemu/qemu_driver.c | 16 ++++++++--------
src/remote/remote_driver.h | 12 +++++++-----
src/secret/secret_driver.c | 3 ++-
src/security/security_apparmor.c | 5 +++--
src/security/virt-aa-helper.c | 7 ++++---
src/storage/storage_backend_disk.c | 3 ++-
src/storage/storage_driver.c | 5 +++--
src/uml/uml_driver.c | 9 +++++----
src/util/hooks.c | 3 ++-
tests/Makefile.am | 1 -
tools/Makefile.am | 2 --
tools/virsh.c | 5 +++--
26 files changed, 79 insertions(+), 72 deletions(-)
diff --git a/bootstrap.conf b/bootstrap.conf
index 12f64c8..2ad1957 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -25,6 +25,7 @@ c-ctype
canonicalize-lgpl
close
connect
+configmake
count-one-bits
crypto/md5
dirname-lgpl
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 8808226..72778e5 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -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) \
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 9446638..aab7667 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -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) {
diff --git a/docs/hooks.html.in b/docs/hooks.html.in
index 2ce785f..3503f8c 100644
--- a/docs/hooks.html.in
+++ b/docs/hooks.html.in
@@ -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
diff --git a/src/Makefile.am b/src/Makefile.am
index 20c0c9f..a9a1986 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 263bb9e..0c5ff8a 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 a6f5558..d83b1fd 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 fab3e11..a98daa3 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 3c8bf30..eba0dee 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 f4479e6..59d1161 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 e4c2c52..f820d6d 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 631fbf1..54890f9 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 4efeb3a..a305de6 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 83a117a..35caccc 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 772fd50..f3b158a 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 49a63bd..1504eec 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 2b5a7c6..c5a876b 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 be39f75..b43c4ac 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/<vm name>.log
+ * LOCALSTATEDIR/log/libvirt/qemu/<vm name>.log
*/
static int
AppArmorSetSecurityProcessLabel(virSecurityDriverPtr drv, virDomainObjPtr vm)
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 5708cd8..0f94fe4 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -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);
}
diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c
index a8864dd..c7ade6b 100644
--- a/src/storage/storage_backend_disk.c
+++ b/src/storage/storage_backend_disk.c
@@ -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
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index f6672d9..6df706b 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -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();
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 3588894..77610d4 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -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 {
diff --git a/src/util/hooks.c b/src/util/hooks.c
index 6e4e2b9..8e24564 100644
--- a/src/util/hooks.c
+++ b/src/util/hooks.c
@@ -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)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 20b6805..77b6fb9 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -17,7 +17,6 @@ INCLUDES = \
$(SASL_CFLAGS) \
$(SELINUX_CFLAGS) \
$(APPARMOR_CFLAGS) \
- -DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
$(COVERAGE_CFLAGS) \
$(WARN_CFLAGS)
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 921d621..376ffa8 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -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) \
diff --git a/tools/virsh.c b/tools/virsh.c
index 3a74053..743d5a1 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -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;
}
--
1.7.3.2
14 years, 1 month