libvirt/src/Makefile.am

2031 lines
60 KiB
Makefile
Raw Normal View History

2005-11-02 12:50:21 +00:00
## Process this file with automake to produce Makefile.in
## Copyright (C) 2005-2018 Red Hat, Inc.
maint: use LGPL correctly Several files called out COPYING or COPYING.LIB instead of using the normal boilerplate. It's especially important that we don't call out COPYING from an LGPL file, since COPYING is traditionally used for the GPL. A few files were lacking copyright altogether. * src/rpc/gendispatch.pl: Add missing copyright. * Makefile.nonreentrant: Likewise. * src/check-symfile.pl: Likewise. * src/check-symsorting.pl: Likewise. * src/driver.h: Likewise. * src/internal.h: Likewise. * tools/libvirt-guests.sh.in: Likewise. * tools/virt-pki-validate.in: Mention copyright in comment, not just code. * tools/virt-sanlock-cleanup.in: Likewise. * src/rpc/genprotocol.pl: Spell out license terms. * src/xen/xend_internal.h: Likewise. * src/xen/xend_internal.c: Likewise. * Makefile.am: Likewise. * daemon/Makefile.am: Likewise. * docs/Makefile.am: Likewise. * docs/schemas/Makefile.am: Likewise. * examples/apparmor/Makefile.am: Likewise. * examples/domain-events/events-c/Makefile.am: Likewise. * examples/dominfo/Makefile.am: Likewise. * examples/domsuspend/Makefile.am: Likewise. * examples/hellolibvirt/Makefile.am: Likewise. * examples/openauth/Makefile.am: Likewise. * examples/python/Makefile.am: Likewise. * examples/systemtap/Makefile.am: Likewise. * examples/xml/nwfilter/Makefile.am: Likewise. * gnulib/lib/Makefile.am: Likewise. * gnulib/tests/Makefile.am: Likewise. * include/Makefile.am: Likewise. * include/libvirt/Makefile.am: Likewise. * python/Makefile.am: Likewise. * python/tests/Makefile.am: Likewise. * src/Makefile.am: Likewise. * tests/Makefile.am: Likewise. * tools/Makefile.am: Likewise. * configure.ac: Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-14 23:42:12 +00:00
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library. If not, see
## <http://www.gnu.org/licenses/>.
# old automake does not provide abs_{src,build}dir variables
abs_builddir = $(shell pwd)
abs_topbuilddir = $(shell cd .. && pwd)
abs_srcdir = $(shell cd $(srcdir) && pwd)
abs_topsrcdir = $(shell cd $(top_srcdir) && pwd)
# No libraries with the exception of LIBXML should be listed
# here. List them against the individual XXX_la_CFLAGS targets
# that actually use them. Also keep GETTEXT_CPPFLAGS at the end.
INCLUDES = -I../gnulib/lib \
-I$(top_srcdir)/gnulib/lib \
-I$(top_srcdir) \
-I../include \
-I$(top_srcdir)/include \
-I$(srcdir)/util \
-I./util \
-DIN_LIBVIRT \
-Dabs_topbuilddir="\"$(abs_topbuilddir)\"" \
-Dabs_topsrcdir="\"$(abs_topsrcdir)\"" \
$(GETTEXT_CPPFLAGS)
WARN_CFLAGS += $(STRICT_FRAME_LIMIT_CFLAGS)
AM_CFLAGS = $(LIBXML_CFLAGS) \
$(WARN_CFLAGS) \
$(LOCK_CHECKING_CFLAGS) \
$(WIN32_EXTRA_CFLAGS) \
$(COVERAGE_CFLAGS)
AM_LDFLAGS = $(DRIVER_MODULES_LDFLAGS) \
$(COVERAGE_LDFLAGS) \
$(RELRO_LDFLAGS) \
$(NO_INDIRECT_LDFLAGS) \
$(CYGWIN_EXTRA_LDFLAGS) \
$(MINGW_EXTRA_LDFLAGS) \
$(NULL)
AM_LDFLAGS_MOD = -module -avoid-version $(AM_LDFLAGS)
AM_LDFLAGS_MOD_NOUNDEF = $(AM_LDFLAGS_MOD) $(NO_UNDEFINED_LDFLAGS)
POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"
EXTRA_DIST = $(conf_DATA)
BUILT_SOURCES =
Rewrite all the DTrace/SystemTAP probing The libvirtd daemon had a few crude system tap probes. Some of these were broken during the RPC rewrite. The new modular RPC code is structured in a way that allows much more effective tracing. Instead of trying to hook up the original probes, define a new set of probes for the RPC and event code. The master probes file is now src/probes.d. This contains probes for virNetServerClientPtr, virNetClientPtr, virSocketPtr virNetTLSContextPtr and virNetTLSSessionPtr modules. Also add probes for the poll event loop. The src/dtrace2systemtap.pl script can convert the probes.d file into a libvirt_probes.stp file to make use from systemtap much simpler. The src/rpc/gensystemtap.pl script can generate a set of systemtap functions for translating RPC enum values into printable strings. This works for all RPC header enums (program, type, status, procedure) and also the authentication enum The PROBE macro will automatically generate a VIR_DEBUG statement, so any place with a PROBE can remove any existing manual DEBUG statements. * daemon/libvirtd.stp, daemon/probes.d: Remove obsolete probing * daemon/libvirtd.h: Remove probe macros * daemon/Makefile.am: Remove all probe buildings/install * daemon/remote.c: Update authentication probes * src/dtrace2systemtap.pl, src/rpc/gensystemtap.pl: Scripts to generate STP files * src/internal.h: Add probe macros * src/probes.d: Master list of probes * src/rpc/virnetclient.c, src/rpc/virnetserverclient.c, src/rpc/virnetsocket.c, src/rpc/virnettlscontext.c, src/util/event_poll.c: Insert probe points, removing any DEBUG statements that duplicate the info
2011-09-30 13:40:23 +00:00
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
nodist_conf_DATA =
DRIVER_SOURCE_FILES =
STATEFUL_DRIVER_SOURCE_FILES =
noinst_LTLIBRARIES =
mod_LTLIBRARIES =
INSTALL_DATA_DIRS =
libvirt_la_BUILT_LIBADD =
SYM_FILES =
USED_SYM_FILES =
GENERATED_SYM_FILES =
augeas_DATA =
augeastest_DATA =
conf_DATA =
AUGEAS_DIRS =
if WITH_DTRACE_PROBES
tapset_DATA =
endif WITH_DTRACE_PROBES
libexec_PROGRAMS =
RPC_PROBE_FILES =
LOGROTATE_FILES_IN =
PODFILES =
MANINFILES =
SYSTEMD_UNIT_FILES_IN =
SYSVINIT_FILES_IN =
UPSTART_FILES =
SYSCONF_FILES =
sbin_PROGRAMS =
man8_MANS =
include conf/Makefile.inc.am
include uml/Makefile.inc.am
include phyp/Makefile.inc.am
include test/Makefile.inc.am
include esx/Makefile.inc.am
include hyperv/Makefile.inc.am
include vmware/Makefile.inc.am
include vbox/Makefile.inc.am
include openvz/Makefile.inc.am
include qemu/Makefile.inc.am
include bhyve/Makefile.inc.am
include xenconfig/Makefile.inc.am
include libxl/Makefile.inc.am
include xen/Makefile.inc.am
include xenapi/Makefile.inc.am
include vz/Makefile.inc.am
include lxc/Makefile.inc.am
include interface/Makefile.inc.am
include network/Makefile.inc.am
include nwfilter/Makefile.inc.am
include node_device/Makefile.inc.am
include secret/Makefile.inc.am
include storage/Makefile.inc.am
include remote/Makefile.inc.am
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)
build: fix linking virt-login-shell After commit 3e2f27e1, I've noticed build failures of virt-login-shell when libapparmor-devel is installed on the build host CCLD virt-login-shell ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o): In function `virExec': /home/jfehlig/virt/upstream/libvirt/src/util/vircommand.c:653: undefined reference to `aa_change_profile' collect2: error: ld returned 1 exit status I was about to commit an easy fix under the build-breaker rule (build-fix-1.patch), but thought to extend the notion of SECDRIVER_LIBS to SECDRIVER_CFLAGS, and use both throughout src/Makefile.am where it makes sense (build-fix-2.patch). Should I just stick with the simple fix, or is something along the lines of patch 2 preferred? Regards, Jim >From a0f35945f3127ab70d051101037e821b1759b4bb Mon Sep 17 00:00:00 2001 From: Jim Fehlig <jfehlig@suse.com> Date: Mon, 21 Oct 2013 15:30:02 -0600 Subject: [PATCH] build: fix virt-login-shell build with apparmor With libapparmor-devel installed, virt-login-shell fails to link CCLD virt-login-shell ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o): In function `virExec': /home/jfehlig/virt/upstream/libvirt/src/util/vircommand.c:653: undefined reference to `aa_change_profile' collect2: error: ld returned 1 exit status Fix by linking libvirt_setuid_rpc_client with previously determined SECDRIVER_LIBS in src/Makefile.am. While at it, introduce SECDRIVER_CFLAGS and use both throughout src/Makefile.am where it makes sense. Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2013-10-21 21:36:11 +00:00
SECDRIVER_CFLAGS =
SECDRIVER_LIBS =
if WITH_SECDRIVER_SELINUX
build: fix linking virt-login-shell After commit 3e2f27e1, I've noticed build failures of virt-login-shell when libapparmor-devel is installed on the build host CCLD virt-login-shell ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o): In function `virExec': /home/jfehlig/virt/upstream/libvirt/src/util/vircommand.c:653: undefined reference to `aa_change_profile' collect2: error: ld returned 1 exit status I was about to commit an easy fix under the build-breaker rule (build-fix-1.patch), but thought to extend the notion of SECDRIVER_LIBS to SECDRIVER_CFLAGS, and use both throughout src/Makefile.am where it makes sense (build-fix-2.patch). Should I just stick with the simple fix, or is something along the lines of patch 2 preferred? Regards, Jim >From a0f35945f3127ab70d051101037e821b1759b4bb Mon Sep 17 00:00:00 2001 From: Jim Fehlig <jfehlig@suse.com> Date: Mon, 21 Oct 2013 15:30:02 -0600 Subject: [PATCH] build: fix virt-login-shell build with apparmor With libapparmor-devel installed, virt-login-shell fails to link CCLD virt-login-shell ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o): In function `virExec': /home/jfehlig/virt/upstream/libvirt/src/util/vircommand.c:653: undefined reference to `aa_change_profile' collect2: error: ld returned 1 exit status Fix by linking libvirt_setuid_rpc_client with previously determined SECDRIVER_LIBS in src/Makefile.am. While at it, introduce SECDRIVER_CFLAGS and use both throughout src/Makefile.am where it makes sense. Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2013-10-21 21:36:11 +00:00
SECDRIVER_CFLAGS += $(SELINUX_CFLAGS)
SECDRIVER_LIBS += $(SELINUX_LIBS)
endif WITH_SECDRIVER_SELINUX
if WITH_SECDRIVER_APPARMOR
build: fix linking virt-login-shell After commit 3e2f27e1, I've noticed build failures of virt-login-shell when libapparmor-devel is installed on the build host CCLD virt-login-shell ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o): In function `virExec': /home/jfehlig/virt/upstream/libvirt/src/util/vircommand.c:653: undefined reference to `aa_change_profile' collect2: error: ld returned 1 exit status I was about to commit an easy fix under the build-breaker rule (build-fix-1.patch), but thought to extend the notion of SECDRIVER_LIBS to SECDRIVER_CFLAGS, and use both throughout src/Makefile.am where it makes sense (build-fix-2.patch). Should I just stick with the simple fix, or is something along the lines of patch 2 preferred? Regards, Jim >From a0f35945f3127ab70d051101037e821b1759b4bb Mon Sep 17 00:00:00 2001 From: Jim Fehlig <jfehlig@suse.com> Date: Mon, 21 Oct 2013 15:30:02 -0600 Subject: [PATCH] build: fix virt-login-shell build with apparmor With libapparmor-devel installed, virt-login-shell fails to link CCLD virt-login-shell ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o): In function `virExec': /home/jfehlig/virt/upstream/libvirt/src/util/vircommand.c:653: undefined reference to `aa_change_profile' collect2: error: ld returned 1 exit status Fix by linking libvirt_setuid_rpc_client with previously determined SECDRIVER_LIBS in src/Makefile.am. While at it, introduce SECDRIVER_CFLAGS and use both throughout src/Makefile.am where it makes sense. Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2013-10-21 21:36:11 +00:00
SECDRIVER_CFLAGS += $(APPARMOR_CFLAGS)
SECDRIVER_LIBS += $(APPARMOR_LIBS)
endif WITH_SECDRIVER_APPARMOR
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
2007-06-15 01:21:18 +00:00
moddir = $(libdir)/libvirt/connection-driver
2008-11-21 12:16:08 +00:00
confdir = $(sysconfdir)/libvirt
conf_DATA += libvirt.conf libvirt-admin.conf
2008-11-21 12:16:08 +00:00
augeasdir = $(datadir)/augeas/lenses
augeastestdir = $(datadir)/augeas/lenses/tests
# These files are not related to driver APIs. Simply generic
# helper APIs for various purposes
UTIL_SOURCES = \
util/viralloc.c util/viralloc.h \
util/virarch.h util/virarch.c \
util/viratomic.h util/viratomic.c \
util/viraudit.c util/viraudit.h \
util/virauth.c util/virauth.h \
util/virauthconfig.c util/virauthconfig.h \
util/virbitmap.c util/virbitmap.h \
util/virbuffer.c util/virbuffer.h \
util/virperf.c util/virperf.h \
util/vircgroup.c util/vircgroup.h util/vircgrouppriv.h \
util/virclosecallbacks.c util/virclosecallbacks.h \
util/vircommand.c util/vircommand.h util/vircommandpriv.h \
util/virconf.c util/virconf.h \
util/vircrypto.c util/vircrypto.h \
util/virdbus.c util/virdbus.h util/virdbuspriv.h \
util/virdnsmasq.c util/virdnsmasq.h \
util/virebtables.c util/virebtables.h \
util/virendian.h \
util/virerror.c util/virerror.h \
util/virevent.c util/virevent.h \
util/vireventpoll.c util/vireventpoll.h \
util/virfcp.c util/virfcp.h \
util/virfdstream.c util/virfdstream.h \
util/virfile.c util/virfile.h \
util/virfirewall.c util/virfirewall.h \
util/virfirewallpriv.h \
util/virfirmware.c util/virfirmware.h \
util/virgettext.c util/virgettext.h \
util/virgic.c util/virgic.h \
util/virhash.c util/virhash.h \
util/virhashcode.c util/virhashcode.h \
util/virhook.c util/virhook.h \
util/virhostcpu.c util/virhostcpu.h util/virhostcpupriv.h \
util/virhostdev.c util/virhostdev.h \
util/virhostmem.c util/virhostmem.h \
util/viridentity.c util/viridentity.h \
util/virinitctl.c util/virinitctl.h \
util/viriptables.c util/viriptables.h \
util/viriscsi.c util/viriscsi.h \
util/virjson.c util/virjson.h \
util/virkeycode.c util/virkeycode.h \
util/virkeyfile.c util/virkeyfile.h \
util/virlease.c util/virlease.h \
util/virlockspace.c util/virlockspace.h \
util/virlog.c util/virlog.h \
util/virmacaddr.h util/virmacaddr.c \
util/virmacmap.h util/virmacmap.c \
util/virnetdev.h util/virnetdev.c \
util/virnetdevbandwidth.h util/virnetdevbandwidth.c \
util/virnetdevbridge.h util/virnetdevbridge.c \
util/virnetdevip.h util/virnetdevip.c \
util/virnetdevmacvlan.c util/virnetdevmacvlan.h \
util/virnetdevmidonet.h util/virnetdevmidonet.c \
util/virnetdevopenvswitch.h util/virnetdevopenvswitch.c \
util/virnetdevtap.h util/virnetdevtap.c \
util/virnetdevveth.h util/virnetdevveth.c \
util/virnetdevvlan.h util/virnetdevvlan.c \
util/virnetdevvportprofile.h util/virnetdevvportprofile.c \
util/virnetlink.c util/virnetlink.h \
util/virnodesuspend.c util/virnodesuspend.h \
util/virkmod.c util/virkmod.h \
util/virnuma.c util/virnuma.h \
util/virobject.c util/virobject.h \
util/virpci.c util/virpci.h \
util/virpidfile.c util/virpidfile.h \
util/virpolkit.c util/virpolkit.h \
util/virportallocator.c util/virportallocator.h \
util/virprobe.h \
util/virprocess.c util/virprocess.h \
util/virqemu.c util/virqemu.h \
util/virrandom.h util/virrandom.c \
util/virresctrl.h util/virresctrl.c util/virresctrlpriv.h \
util/virrotatingfile.h util/virrotatingfile.c \
util/virscsi.c util/virscsi.h \
util/virscsihost.c util/virscsihost.h \
util/virscsivhost.c util/virscsivhost.h \
util/virseclabel.c util/virseclabel.h \
util/virsecret.c util/virsecret.h \
util/virsexpr.c util/virsexpr.h \
util/virsocketaddr.h util/virsocketaddr.c \
util/virstorageencryption.c util/virstorageencryption.h \
util/virstoragefile.c util/virstoragefile.h \
util/virstoragefilebackend.c util/virstoragefilebackend.h \
util/virstring.h util/virstring.c \
util/virsysinfo.c util/virsysinfo.h util/virsysinfopriv.h \
util/virsystemd.c util/virsystemd.h util/virsystemdpriv.h \
util/virthread.c util/virthread.h \
util/virthreadjob.c util/virthreadjob.h \
util/virthreadpool.c util/virthreadpool.h \
util/virtime.h util/virtime.c \
util/virtpm.h util/virtpm.c \
util/virtypedparam.c util/virtypedparam.h \
util/virusb.c util/virusb.h \
util/viruri.h util/viruri.c \
util/virutil.c util/virutil.h \
util/viruuid.c util/viruuid.h \
util/virvhba.c util/virvhba.h \
util/virxdrdefs.h \
util/virxml.c util/virxml.h \
util/virmdev.c util/virmdev.h \
util/virfilecache.c util/virfilecache.h \
2012-12-13 17:44:57 +00:00
$(NULL)
EXTRA_DIST += \
$(srcdir)/keycodemapdb/data/keymaps.csv \
$(srcdir)/keycodemapdb/tools/keymap-gen \
$(NULL)
util/virkeycodetable_%.h: $(srcdir)/keycodemapdb/data/keymaps.csv \
$(srcdir)/keycodemapdb/tools/keymap-gen Makefile.am
$(AM_V_GEN)export NAME=`echo $@ | sed -e 's,util/virkeycodetable_,,' \
-e 's,\.h,,'` && \
$(MKDIR_P) util/ && \
$(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \
--lang stdc --varname virKeyCodeTable_$$NAME code-table \
$(srcdir)/keycodemapdb/data/keymaps.csv $$NAME > $@-tmp && \
mv $@-tmp $@ || rm -f $@-tmp
util/virkeynametable_%.h: $(srcdir)/keycodemapdb/data/keymaps.csv \
$(srcdir)/keycodemapdb/tools/keymap-gen Makefile.am
$(AM_V_GEN)export NAME=`echo $@ | sed -e 's,util/virkeynametable_,,' \
-e 's,\.h,,'` && \
$(MKDIR_P) util/ && \
$(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \
--lang stdc --varname virKeyNameTable_$$NAME name-table \
$(srcdir)/keycodemapdb/data/keymaps.csv $$NAME > $@-tmp && \
mv $@-tmp $@ || rm -f $@-tmp
util/virkeycode-%.pod: $(srcdir)/keycodemapdb/data/keymaps.csv \
$(srcdir)/keycodemapdb/tools/keymap-gen Makefile.am
$(AM_V_GEN)export NAME=`echo $@ | sed -e 's,util/virkeycode-,,' \
-e 's,\.pod,,'` && \
$(MKDIR_P) util/ && \
$(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \
--lang pod --varname "Key code values for $$NAME" code-docs \
$(srcdir)/keycodemapdb/data/keymaps.csv $$NAME > \
$@-tmp && mv $@-tmp $@ || rm $@-tmp
util/virkeyname-%.pod: $(srcdir)/keycodemapdb/data/keymaps.csv \
$(srcdir)/keycodemapdb/tools/keymap-gen Makefile.am
$(AM_V_GEN)export NAME=`echo $@ | sed -e 's,util/virkeyname-,,' \
-e 's,\.pod,,'` && \
$(MKDIR_P) util/ && \
$(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \
--lang pod --varname "Key name values for $$NAME" name-docs \
$(srcdir)/keycodemapdb/data/keymaps.csv $$NAME > \
$@-tmp && mv $@-tmp $@ || rm $@-tmp
util/virkey%.7: util/virkey%.pod
$(AM_V_GEN)$(POD2MAN) --section=7 $< $@-t1 && \
if grep 'POD ERROR' $@-t1; then rm $@-t1; exit 1; fi && \
sed \
-e 's|SYSCONFDIR|\@sysconfdir\@|g' \
-e 's|LOCALSTATEDIR|\@localstatedir\@|g' \
< $@-t1 > $@-t2 && \
rm -f $@-t1 && \
mv $@-t2 $@
KEYCODES = linux osx atset1 atset2 atset3 xtkbd usb win32 rfb
KEYNAMES = linux osx win32
KEYTABLES = \
$(KEYCODES:%=util/virkeycodetable_%.h) \
$(KEYNAMES:%=util/virkeynametable_%.h) \
$(NULL)
KEYPODS = $(KEYCODES:%=util/virkeycode-%.pod) \
$(KEYNAMES:%=util/virkeyname-%.pod)
KEYMANS = $(KEYPODS:%.pod=%.7)
man7_MANS = $(KEYMANS)
UTIL_SOURCES += $(KEYTABLES)
BUILT_SOURCES += $(KEYTABLES)
MAINTAINERCLEANFILES += $(KEYTABLES)
CLEANFILES += $(KEYMANS) $(KEYPODS)
# Internal generic driver infrastructure
DATATYPES_SOURCES = datatypes.h datatypes.c
DRIVER_SOURCES = \
driver.c driver.h \
driver-hypervisor.h \
driver-interface.h \
driver-network.h \
driver-nodedev.h \
driver-nwfilter.h \
driver-secret.h \
driver-state.h \
driver-storage.h \
driver-stream.h \
internal.h \
$(DATATYPES_SOURCES) \
libvirt.c libvirt_internal.h \
libvirt-domain.c \
libvirt-domain-snapshot.c \
libvirt-host.c \
libvirt-interface.c \
libvirt-network.c \
libvirt-nodedev.c \
libvirt-nwfilter.c \
libvirt-secret.c \
libvirt-storage.c \
libvirt-stream.c \
locking/lock_manager.c locking/lock_manager.h \
locking/lock_driver.h \
locking/lock_driver_nop.h locking/lock_driver_nop.c \
locking/domain_lock.h locking/domain_lock.c \
logging/log_manager.c logging/log_manager.h \
$(NULL)
LOCK_DRIVER_SANLOCK_SOURCES = \
locking/lock_driver_sanlock.c
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
locking/sanlock_helper.c
LOCK_PROTOCOL_GENERATED = \
build: avoid $(srcdir) in *_SOURCES Trying to enable automake's subdir-objects option resulted in the creation of literal directories such as src/$(srcdir)/remote/. I traced this to the fact that we had used a literal $(srcdir) in a location that later fed an automake *_SOURCES variable. This has also been reported as an automake bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928 but it's better to fix our code than to wait for an automake fix. Some things to remember that affect VPATH builds, and where an in-tree build is blissfully unaware of the issues: if a VPATH build fails to find a file that was used as a prereq of any other target, then the rule for that file will expand $@ to prefer the current build dir (bad because a VPATH build on a fresh checkout will then stick $@ in the current directory instead of the desired srcdir); conversely, if a VPATH build finds the file in srcdir but decides it needs to be rebuilt, then the rule for that file will expand $@ to include the directory where it was found out-of-date (bad for an explicit listing of $(srcdir)/$@ because an incremental VPATH build will then expand srcdir twice). As we want these files to go into srcdir unconditionally, we have to massage or avoid $@ for any recipe that involves one of these files. Therefore, this patch removes all uses of $(srcdir) from any generated file name that later feeds a *_SOURCES variable, and then rewrites all the recipes to generate those files to hard-code their creation into srcdir without the use of $@. * src/Makefile.am (REMOTE_DRIVER_GENERATED): Drop $(srcdir); VPATH builds know how to find the files, and automake subdir-objects fails with it in place. (LXC_MONITOR_PROTOCOL_GENERATED, (LXC_MONITOR_GENERATED) (ACCESS_DRIVER_GENERATED, LOCK_PROTOCOL_GENERATED): Likewise. (*_client_bodies.h): Hard-code rules to write into srcdir, as VPATH tries to build $@ locally if missing. (util/virkeymaps.h): Likewise. (lxc/lxc_monitor_dispatch.h): Likewise. (access/viraccessapi*): Likewise. (locking/lock_daemon_dispatch_stubs.h): Likewise. * daemon/Makeflie.am (DAEMON_GENERATED, remote_dispatch.h): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com> fixup DAEMON_GENERATED
2013-09-06 22:54:39 +00:00
locking/lock_protocol.h \
locking/lock_protocol.c \
$(NULL)
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
$(LOCK_PROTOCOL_GENERATED)
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)
LOCK_DAEMON_GENERATED = \
locking/lock_daemon_dispatch_stubs.h
$(NULL)
BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)
LOCK_DRIVER_LOCKD_SOURCES = \
locking/lock_driver_lockd.c \
locking/lock_driver_lockd.h \
$(NULL)
LOCK_DAEMON_SOURCES = \
locking/lock_daemon.h \
locking/lock_daemon.c \
locking/lock_daemon_config.h \
locking/lock_daemon_config.c \
locking/lock_daemon_dispatch.c \
locking/lock_daemon_dispatch.h \
$(NULL)
build: avoid $(srcdir) in *_SOURCES Trying to enable automake's subdir-objects option resulted in the creation of literal directories such as src/$(srcdir)/remote/. I traced this to the fact that we had used a literal $(srcdir) in a location that later fed an automake *_SOURCES variable. This has also been reported as an automake bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928 but it's better to fix our code than to wait for an automake fix. Some things to remember that affect VPATH builds, and where an in-tree build is blissfully unaware of the issues: if a VPATH build fails to find a file that was used as a prereq of any other target, then the rule for that file will expand $@ to prefer the current build dir (bad because a VPATH build on a fresh checkout will then stick $@ in the current directory instead of the desired srcdir); conversely, if a VPATH build finds the file in srcdir but decides it needs to be rebuilt, then the rule for that file will expand $@ to include the directory where it was found out-of-date (bad for an explicit listing of $(srcdir)/$@ because an incremental VPATH build will then expand srcdir twice). As we want these files to go into srcdir unconditionally, we have to massage or avoid $@ for any recipe that involves one of these files. Therefore, this patch removes all uses of $(srcdir) from any generated file name that later feeds a *_SOURCES variable, and then rewrites all the recipes to generate those files to hard-code their creation into srcdir without the use of $@. * src/Makefile.am (REMOTE_DRIVER_GENERATED): Drop $(srcdir); VPATH builds know how to find the files, and automake subdir-objects fails with it in place. (LXC_MONITOR_PROTOCOL_GENERATED, (LXC_MONITOR_GENERATED) (ACCESS_DRIVER_GENERATED, LOCK_PROTOCOL_GENERATED): Likewise. (*_client_bodies.h): Hard-code rules to write into srcdir, as VPATH tries to build $@ locally if missing. (util/virkeymaps.h): Likewise. (lxc/lxc_monitor_dispatch.h): Likewise. (access/viraccessapi*): Likewise. (locking/lock_daemon_dispatch_stubs.h): Likewise. * daemon/Makeflie.am (DAEMON_GENERATED, remote_dispatch.h): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com> fixup DAEMON_GENERATED
2013-09-06 22:54:39 +00:00
locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \
$(srcdir)/rpc/gendispatch.pl Makefile.am
$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
virLockSpaceProtocol VIR_LOCK_SPACE_PROTOCOL \
build: avoid $(srcdir) in *_SOURCES Trying to enable automake's subdir-objects option resulted in the creation of literal directories such as src/$(srcdir)/remote/. I traced this to the fact that we had used a literal $(srcdir) in a location that later fed an automake *_SOURCES variable. This has also been reported as an automake bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928 but it's better to fix our code than to wait for an automake fix. Some things to remember that affect VPATH builds, and where an in-tree build is blissfully unaware of the issues: if a VPATH build fails to find a file that was used as a prereq of any other target, then the rule for that file will expand $@ to prefer the current build dir (bad because a VPATH build on a fresh checkout will then stick $@ in the current directory instead of the desired srcdir); conversely, if a VPATH build finds the file in srcdir but decides it needs to be rebuilt, then the rule for that file will expand $@ to include the directory where it was found out-of-date (bad for an explicit listing of $(srcdir)/$@ because an incremental VPATH build will then expand srcdir twice). As we want these files to go into srcdir unconditionally, we have to massage or avoid $@ for any recipe that involves one of these files. Therefore, this patch removes all uses of $(srcdir) from any generated file name that later feeds a *_SOURCES variable, and then rewrites all the recipes to generate those files to hard-code their creation into srcdir without the use of $@. * src/Makefile.am (REMOTE_DRIVER_GENERATED): Drop $(srcdir); VPATH builds know how to find the files, and automake subdir-objects fails with it in place. (LXC_MONITOR_PROTOCOL_GENERATED, (LXC_MONITOR_GENERATED) (ACCESS_DRIVER_GENERATED, LOCK_PROTOCOL_GENERATED): Likewise. (*_client_bodies.h): Hard-code rules to write into srcdir, as VPATH tries to build $@ locally if missing. (util/virkeymaps.h): Likewise. (lxc/lxc_monitor_dispatch.h): Likewise. (access/viraccessapi*): Likewise. (locking/lock_daemon_dispatch_stubs.h): Likewise. * daemon/Makeflie.am (DAEMON_GENERATED, remote_dispatch.h): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com> fixup DAEMON_GENERATED
2013-09-06 22:54:39 +00:00
$(LOCK_PROTOCOL) > $(srcdir)/locking/lock_daemon_dispatch_stubs.h
LOG_PROTOCOL_GENERATED = \
logging/log_protocol.h \
logging/log_protocol.c \
$(NULL)
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)
LOG_PROTOCOL = $(srcdir)/logging/log_protocol.x
EXTRA_DIST += $(LOG_PROTOCOL) \
$(LOG_PROTOCOL_GENERATED)
BUILT_SOURCES += $(LOG_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOG_PROTOCOL_GENERATED)
LOG_DAEMON_GENERATED = \
logging/log_daemon_dispatch_stubs.h
$(NULL)
BUILT_SOURCES += $(LOG_DAEMON_GENERATED)
EXTRA_DIST += $(LOG_DAEMON_GENERATED)
MAINTAINERCLEANFILES += $(LOG_DAEMON_GENERATED)
LOG_DAEMON_SOURCES = \
logging/log_daemon.h \
logging/log_daemon.c \
logging/log_daemon_config.h \
logging/log_daemon_config.c \
logging/log_daemon_dispatch.c \
logging/log_daemon_dispatch.h \
logging/log_handler.c \
logging/log_handler.h \
$(NULL)
logging/log_daemon_dispatch_stubs.h: $(LOG_PROTOCOL) \
$(srcdir)/rpc/gendispatch.pl Makefile.am
$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
virLogManagerProtocol VIR_LOG_MANAGER_PROTOCOL \
$(LOG_PROTOCOL) > $(srcdir)/logging/log_daemon_dispatch_stubs.h
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x
ADMIN_PROTOCOL_GENERATED = \
admin/admin_protocol.c \
admin/admin_protocol.h \
admin/admin_client.h \
admin/admin_server_dispatch_stubs.h \
$(NULL)
admin/admin_client.h: $(srcdir)/rpc/gendispatch.pl \
$(ADMIN_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
admin ADMIN $(ADMIN_PROTOCOL) \
> $(srcdir)/admin/admin_client.h
admin/admin_server_dispatch_stubs.h: $(srcdir)/rpc/gendispatch.pl \
$(ADMIN_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
admin ADMIN $(ADMIN_PROTOCOL) \
> $(srcdir)/admin/admin_server_dispatch_stubs.h
EXTRA_DIST += $(ADMIN_PROTOCOL) $(ADMIN_PROTOCOL_GENERATED)
BUILT_SOURCES += $(ADMIN_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(ADMIN_PROTOCOL_GENERATED)
# Ensure that we don't change the struct or member names or member ordering
# in remote_protocol.x The embedded perl below needs a few comments, and
# presumes you know what pdwtags output looks like:
# * use -0777 -n to slurp the entire file into $_.
# * the "split" splits on the /* DD */ comments, so that $p iterates
# through the struct definitions.
# * process only "struct remote_..." entries
# * remove comments and preceding TAB throughout
# * remove empty lines throughout
# * remove white space at end of buffer
# With pdwtags 1.8, --verbose output includes separators like these:
# /* 93 */
# /* <0> (null):0 */
# with the second line omitted for intrinsic types.
# Whereas with pdwtags 1.3, they look like this:
# /* <2d2> /usr/include/libio.h:180 */
# The alternation of the following regexps matches both cases.
r1 = /\* \d+ \*/
r2 = /\* <[[:xdigit:]]+> \S+:\d+ \*/
libs_prefix = remote_|qemu_|lxc_|admin_
other_prefix = keepalive|vir(Net|LockSpace|LXCMonitor)
struct_prefix = ($(libs_prefix)|$(other_prefix))
# Depending on configure options, libtool creates one or both of
build: use automake subdir-objects Automake 2.0 will enable subdir-objects by default; in preparation for that change, automake 1.14 outputs LOADS of warnings: daemon/Makefile.am:38: warning: source file '../src/remote/remote_protocol.c' is in a subdirectory, daemon/Makefile.am:38: but option 'subdir-objects' is disabled automake-1.14: warning: possible forward-incompatibility. automake-1.14: At least a source file is in a subdirectory, but the 'subdir-objects' automake-1.14: automake option hasn't been enabled. For now, the corresponding output automake-1.14: object file(s) will be placed in the top-level directory. However, automake-1.14: this behaviour will change in future Automake versions: they will automake-1.14: unconditionally cause object files to be placed in the same subdirectory automake-1.14: of the corresponding sources. automake-1.14: You are advised to start using 'subdir-objects' option throughout your automake-1.14: project, to avoid future incompatibilities. daemon/Makefile.am:38: warning: source file '../src/remote/lxc_protocol.c' is in a subdirectory, daemon/Makefile.am:38: but option 'subdir-objects' is disabled ... As automake 1.9 also supported this option, and the previous patches fixed up the code base to work with it, it is safe to now turn it on unconditionally. * configure.ac (AM_INIT_AUTOMAKE): Enable subdir-objects. * .gitignore: Ignore .dirstamp directories. * src/Makefile.am (PDWTAGS, *-protocol-struct): Adjust to new subdir-object location of .lo files. Signed-off-by: Eric Blake <eblake@redhat.com>
2013-09-07 22:18:06 +00:00
# remote/{,.libs/}libvirt_driver_remote_la-remote_protocol.o. We want
# the newest of the two, in case configure options changed and a stale
# file is left around from an earlier build.
# The pdwtags output is completely different when building with clang
# which causes the comparison against expected output to fail, so skip
# if using clang as CC.
PDWTAGS = \
$(AM_V_GEN)if $(CC) -v 2>&1 | grep -q clang; then \
echo 'WARNING: skipping pdwtags test with Clang' >&2; \
exit 0; \
fi; \
if (pdwtags --help) > /dev/null 2>&1; then \
o=`ls -t $(<:.lo=.$(OBJEXT)) \
$(subst /,/.libs/,$(<:.lo=.$(OBJEXT))) \
2>/dev/null | sed -n 1p`; \
test -f "$$o" || { echo ".o for $< not found" >&2; exit 1; }; \
pdwtags --verbose $$o > $(@F)-t1 2> $(@F)-t2; \
if test ! -s $(@F)-t1 && test -s $(@F)-t2; then \
rm -rf $(@F)-t?; \
echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\
else \
$(PERL) -0777 -n \
-e 'foreach my $$p (split m!\n*(?:$(r1)|$(r2))\n!) {' \
-e ' if ($$p =~ /^(struct|enum) $(struct_prefix)/ ||' \
-e ' $$p =~ /^enum \{/) {' \
-e ' $$p =~ s!\t*/\*.*?\*/!!sg;' \
-e ' $$p =~ s!\s+\n!\n!sg;' \
-e ' $$p =~ s!\s+$$!!;' \
-e ' $$p =~ s!\t! !g;' \
-e ' print "$$p\n";' \
-e ' $$n++;' \
-e ' }' \
-e '}' \
-e 'BEGIN {' \
-e ' print "/* -*- c -*- */\n";' \
-e '}' \
-e 'END {' \
-e ' if ($$n < 1) {' \
-e ' warn "WARNING: your pdwtags program is too old\n";' \
-e ' warn "WARNING: skipping the $@ test\n";' \
-e ' warn "WARNING: install dwarves-1.3 or newer\n";' \
-e ' exit 8;' \
-e ' }' \
-e '}' \
< $(@F)-t1 > $(@F)-t3; \
case $$? in 8) rm -f $(@F)-t?; exit 0;; 0) ;; *) exit 1;; esac;\
diff -u $(@)s $(@F)-t3; st=$$?; rm -f $(@F)-t?; exit $$st; \
fi; \
else \
echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2; \
echo 'WARNING: install the dwarves package to get pdwtags' >&2; \
fi
# .libs/libvirt.so is built by libtool as a side-effect of the Makefile
# rule for libvirt.la. However, checking symbols relies on Linux ELF layout
if WITH_LINUX
check-symfile: libvirt.syms libvirt.la
$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt.syms \
.libs/libvirt.so
check-admin-symfile: libvirt_admin.syms libvirt-admin.la
$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt_admin.syms \
.libs/libvirt-admin.so
else ! WITH_LINUX
check-symfile:
check-admin-symfile:
endif ! WITH_LINUX
check-symsorting:
$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
$(srcdir) $(SYM_FILES)
check-admin-symsorting:
$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
$(srcdir) $(ADMIN_SYM_FILES)
2012-12-13 22:13:21 +00:00
EXTRA_DIST += check-symfile.pl check-symsorting.pl
# Keep this list synced with RPC_PROBE_FILES
PROTOCOL_STRUCTS = \
$(srcdir)/remote_protocol-structs \
$(srcdir)/lxc_protocol-structs \
$(srcdir)/qemu_protocol-structs \
$(srcdir)/virnetprotocol-structs \
$(srcdir)/virkeepaliveprotocol-structs \
$(srcdir)/lxc_monitor_protocol-structs \
$(srcdir)/lock_protocol-structs \
$(srcdir)/admin_protocol-structs \
$(NULL)
if WITH_REMOTE
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)
# The .o file that pdwtags parses is created as a side effect of running
# libtool; but from make's perspective we depend on the .lo file.
$(srcdir)/remote_protocol-struct \
$(srcdir)/qemu_protocol-struct \
$(srcdir)/lxc_protocol-struct: \
build: use automake subdir-objects Automake 2.0 will enable subdir-objects by default; in preparation for that change, automake 1.14 outputs LOADS of warnings: daemon/Makefile.am:38: warning: source file '../src/remote/remote_protocol.c' is in a subdirectory, daemon/Makefile.am:38: but option 'subdir-objects' is disabled automake-1.14: warning: possible forward-incompatibility. automake-1.14: At least a source file is in a subdirectory, but the 'subdir-objects' automake-1.14: automake option hasn't been enabled. For now, the corresponding output automake-1.14: object file(s) will be placed in the top-level directory. However, automake-1.14: this behaviour will change in future Automake versions: they will automake-1.14: unconditionally cause object files to be placed in the same subdirectory automake-1.14: of the corresponding sources. automake-1.14: You are advised to start using 'subdir-objects' option throughout your automake-1.14: project, to avoid future incompatibilities. daemon/Makefile.am:38: warning: source file '../src/remote/lxc_protocol.c' is in a subdirectory, daemon/Makefile.am:38: but option 'subdir-objects' is disabled ... As automake 1.9 also supported this option, and the previous patches fixed up the code base to work with it, it is safe to now turn it on unconditionally. * configure.ac (AM_INIT_AUTOMAKE): Enable subdir-objects. * .gitignore: Ignore .dirstamp directories. * src/Makefile.am (PDWTAGS, *-protocol-struct): Adjust to new subdir-object location of .lo files. Signed-off-by: Eric Blake <eblake@redhat.com>
2013-09-07 22:18:06 +00:00
$(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo
$(PDWTAGS)
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
build: use automake subdir-objects Automake 2.0 will enable subdir-objects by default; in preparation for that change, automake 1.14 outputs LOADS of warnings: daemon/Makefile.am:38: warning: source file '../src/remote/remote_protocol.c' is in a subdirectory, daemon/Makefile.am:38: but option 'subdir-objects' is disabled automake-1.14: warning: possible forward-incompatibility. automake-1.14: At least a source file is in a subdirectory, but the 'subdir-objects' automake-1.14: automake option hasn't been enabled. For now, the corresponding output automake-1.14: object file(s) will be placed in the top-level directory. However, automake-1.14: this behaviour will change in future Automake versions: they will automake-1.14: unconditionally cause object files to be placed in the same subdirectory automake-1.14: of the corresponding sources. automake-1.14: You are advised to start using 'subdir-objects' option throughout your automake-1.14: project, to avoid future incompatibilities. daemon/Makefile.am:38: warning: source file '../src/remote/lxc_protocol.c' is in a subdirectory, daemon/Makefile.am:38: but option 'subdir-objects' is disabled ... As automake 1.9 also supported this option, and the previous patches fixed up the code base to work with it, it is safe to now turn it on unconditionally. * configure.ac (AM_INIT_AUTOMAKE): Enable subdir-objects. * .gitignore: Ignore .dirstamp directories. * src/Makefile.am (PDWTAGS, *-protocol-struct): Adjust to new subdir-object location of .lo files. Signed-off-by: Eric Blake <eblake@redhat.com>
2013-09-07 22:18:06 +00:00
$(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo
$(PDWTAGS)
$(srcdir)/lxc_monitor_protocol-struct: \
build: use automake subdir-objects Automake 2.0 will enable subdir-objects by default; in preparation for that change, automake 1.14 outputs LOADS of warnings: daemon/Makefile.am:38: warning: source file '../src/remote/remote_protocol.c' is in a subdirectory, daemon/Makefile.am:38: but option 'subdir-objects' is disabled automake-1.14: warning: possible forward-incompatibility. automake-1.14: At least a source file is in a subdirectory, but the 'subdir-objects' automake-1.14: automake option hasn't been enabled. For now, the corresponding output automake-1.14: object file(s) will be placed in the top-level directory. However, automake-1.14: this behaviour will change in future Automake versions: they will automake-1.14: unconditionally cause object files to be placed in the same subdirectory automake-1.14: of the corresponding sources. automake-1.14: You are advised to start using 'subdir-objects' option throughout your automake-1.14: project, to avoid future incompatibilities. daemon/Makefile.am:38: warning: source file '../src/remote/lxc_protocol.c' is in a subdirectory, daemon/Makefile.am:38: but option 'subdir-objects' is disabled ... As automake 1.9 also supported this option, and the previous patches fixed up the code base to work with it, it is safe to now turn it on unconditionally. * configure.ac (AM_INIT_AUTOMAKE): Enable subdir-objects. * .gitignore: Ignore .dirstamp directories. * src/Makefile.am (PDWTAGS, *-protocol-struct): Adjust to new subdir-object location of .lo files. Signed-off-by: Eric Blake <eblake@redhat.com>
2013-09-07 22:18:06 +00:00
$(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo
$(PDWTAGS)
$(srcdir)/lock_protocol-struct: \
build: use automake subdir-objects Automake 2.0 will enable subdir-objects by default; in preparation for that change, automake 1.14 outputs LOADS of warnings: daemon/Makefile.am:38: warning: source file '../src/remote/remote_protocol.c' is in a subdirectory, daemon/Makefile.am:38: but option 'subdir-objects' is disabled automake-1.14: warning: possible forward-incompatibility. automake-1.14: At least a source file is in a subdirectory, but the 'subdir-objects' automake-1.14: automake option hasn't been enabled. For now, the corresponding output automake-1.14: object file(s) will be placed in the top-level directory. However, automake-1.14: this behaviour will change in future Automake versions: they will automake-1.14: unconditionally cause object files to be placed in the same subdirectory automake-1.14: of the corresponding sources. automake-1.14: You are advised to start using 'subdir-objects' option throughout your automake-1.14: project, to avoid future incompatibilities. daemon/Makefile.am:38: warning: source file '../src/remote/lxc_protocol.c' is in a subdirectory, daemon/Makefile.am:38: but option 'subdir-objects' is disabled ... As automake 1.9 also supported this option, and the previous patches fixed up the code base to work with it, it is safe to now turn it on unconditionally. * configure.ac (AM_INIT_AUTOMAKE): Enable subdir-objects. * .gitignore: Ignore .dirstamp directories. * src/Makefile.am (PDWTAGS, *-protocol-struct): Adjust to new subdir-object location of .lo files. Signed-off-by: Eric Blake <eblake@redhat.com>
2013-09-07 22:18:06 +00:00
$(srcdir)/%-struct: locking/lockd_la-%.lo
$(PDWTAGS)
$(srcdir)/admin_protocol-struct: \
$(srcdir)/%-struct: admin/libvirt_admin_la-%.lo
$(PDWTAGS)
else !WITH_REMOTE
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
endif !WITH_REMOTE
2012-12-13 22:13:21 +00:00
EXTRA_DIST += $(PROTOCOL_STRUCTS)
check-drivername:
$(AM_V_GEN)$(PERL) $(srcdir)/check-drivername.pl \
$(srcdir)/driver.h \
$(srcdir)/libvirt_public.syms \
$(srcdir)/libvirt_admin_public.syms \
$(srcdir)/libvirt_qemu.syms \
$(srcdir)/libvirt_lxc.syms
EXTRA_DIST += check-drivername.pl
check-driverimpls:
$(AM_V_GEN)$(PERL) $(srcdir)/check-driverimpls.pl \
$(filter /%,$(DRIVER_SOURCE_FILES)) \
$(filter $(srcdir)/%,$(DRIVER_SOURCE_FILES)) \
$(addprefix $(srcdir)/,$(filter-out $(srcdir)/%, \
$(filter-out /%,$(DRIVER_SOURCE_FILES))))
check-aclrules:
$(AM_V_GEN)$(PERL) $(srcdir)/check-aclrules.pl \
$(REMOTE_PROTOCOL) \
$(addprefix $(srcdir)/,$(filter-out /%,$(STATEFUL_DRIVER_SOURCE_FILES)))
check-aclperms:
$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
$(srcdir)/access/viraccessperm.h \
$(srcdir)/access/viraccessperm.c
EXTRA_DIST += check-driverimpls.pl check-aclrules.pl check-aclperms.pl
check-local: check-protocol check-symfile check-symsorting \
check-drivername check-driverimpls check-aclrules \
check-aclperms check-admin-symfile check-admin-symsorting
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES = \
$(DATATYPES_SOURCES) \
security/virt-aa-helper.c
UTIL_IO_HELPER_SOURCES = \
util/iohelper.c
# Security framework and drivers for various models
SECURITY_DRIVER_SOURCES = \
security/security_driver.h security/security_driver.c \
security/security_nop.h security/security_nop.c \
security/security_stack.h security/security_stack.c \
security/security_dac.h security/security_dac.c \
Refactor the security drivers to simplify usage The current security driver usage requires horrible code like if (driver->securityDriver && driver->securityDriver->domainSetSecurityHostdevLabel && driver->securityDriver->domainSetSecurityHostdevLabel(driver->securityDriver, vm, hostdev) < 0) This pair of checks for NULL clutters up the code, making the driver calls 2 lines longer than they really need to be. The goal of the patchset is to change the calling convention to simply if (virSecurityManagerSetHostdevLabel(driver->securityDriver, vm, hostdev) < 0) The first check for 'driver->securityDriver' being NULL is removed by introducing a 'no op' security driver that will always be present if no real driver is enabled. This guarentees driver->securityDriver != NULL. The second check for 'driver->securityDriver->domainSetSecurityHostdevLabel' being non-NULL is hidden in a new abstraction called virSecurityManager. This separates the driver callbacks, from main internal API. The addition of a virSecurityManager object, that is separate from the virSecurityDriver struct also allows for security drivers to carry state / configuration information directly. Thus the DAC/Stack drivers from src/qemu which used to pull config from 'struct qemud_driver' can now be moved into the 'src/security' directory and store their config directly. * src/qemu/qemu_conf.h, src/qemu/qemu_driver.c: Update to use new virSecurityManager APIs * src/qemu/qemu_security_dac.c, src/qemu/qemu_security_dac.h src/qemu/qemu_security_stacked.c, src/qemu/qemu_security_stacked.h: Move into src/security directory * src/security/security_stack.c, src/security/security_stack.h, src/security/security_dac.c, src/security/security_dac.h: Generic versions of previous QEMU specific drivers * src/security/security_apparmor.c, src/security/security_apparmor.h, src/security/security_driver.c, src/security/security_driver.h, src/security/security_selinux.c, src/security/security_selinux.h: Update to take virSecurityManagerPtr object as the first param in all callbacks * src/security/security_nop.c, src/security/security_nop.h: Stub implementation of all security driver APIs. * src/security/security_manager.h, src/security/security_manager.c: New internal API for invoking security drivers * src/libvirt.c: Add missing debug for security APIs
2010-11-17 20:26:30 +00:00
security/security_manager.h security/security_manager.c
SECURITY_DRIVER_SELINUX_SOURCES = \
security/security_selinux.h security/security_selinux.c
SECURITY_DRIVER_APPARMOR_SOURCES = \
security/security_apparmor.h security/security_apparmor.c
Auto-generate helpers for checking access control rules Extend the 'gendispatch.pl' script to be able to generate three new types of file. - 'aclheader' - defines signatures of helper APIs for doing authorization checks. There is one helper API for each API requiring an auth check. Any @acl annotations result in a method being generated with a suffix of 'EnsureACL'. If the ACL check requires examination of flags, an extra 'flags' param will be present. Some examples extern int virConnectBaselineCPUEnsureACL(void); extern int virConnectDomainEventDeregisterEnsureACL(virDomainDefPtr domain); extern int virDomainAttachDeviceFlagsEnsureACL(virDomainDefPtr domain, unsigned int flags); Any @aclfilter annotations resuilt in a method being generated with a suffix of 'CheckACL'. extern int virConnectListAllDomainsCheckACL(virDomainDefPtr domain); These are used for filtering individual objects from APIs which return a list of objects - 'aclbody' - defines the actual implementation of the methods described above. This calls into the access manager APIs. A complex example: /* Returns: -1 on error (denied==error), 0 on allowed */ int virDomainAttachDeviceFlagsEnsureACL(virConnectPtr conn, virDomainDefPtr domain, unsigned int flags) { virAccessManagerPtr mgr; int rv; if (!(mgr = virAccessManagerGetDefault())) return -1; if ((rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_WRITE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE)) == 0) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG)) == (VIR_DOMAIN_AFFECT_CONFIG)) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } virObjectUnref(mgr); return 0; } - 'aclsyms' - generates a linker script to export the APIs to drivers. Some examples virConnectBaselineCPUEnsureACL; virConnectCompareCPUEnsureACL; Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-04-18 16:49:41 +00:00
ACCESS_DRIVER_GENERATED = \
build: avoid $(srcdir) in *_SOURCES Trying to enable automake's subdir-objects option resulted in the creation of literal directories such as src/$(srcdir)/remote/. I traced this to the fact that we had used a literal $(srcdir) in a location that later fed an automake *_SOURCES variable. This has also been reported as an automake bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928 but it's better to fix our code than to wait for an automake fix. Some things to remember that affect VPATH builds, and where an in-tree build is blissfully unaware of the issues: if a VPATH build fails to find a file that was used as a prereq of any other target, then the rule for that file will expand $@ to prefer the current build dir (bad because a VPATH build on a fresh checkout will then stick $@ in the current directory instead of the desired srcdir); conversely, if a VPATH build finds the file in srcdir but decides it needs to be rebuilt, then the rule for that file will expand $@ to include the directory where it was found out-of-date (bad for an explicit listing of $(srcdir)/$@ because an incremental VPATH build will then expand srcdir twice). As we want these files to go into srcdir unconditionally, we have to massage or avoid $@ for any recipe that involves one of these files. Therefore, this patch removes all uses of $(srcdir) from any generated file name that later feeds a *_SOURCES variable, and then rewrites all the recipes to generate those files to hard-code their creation into srcdir without the use of $@. * src/Makefile.am (REMOTE_DRIVER_GENERATED): Drop $(srcdir); VPATH builds know how to find the files, and automake subdir-objects fails with it in place. (LXC_MONITOR_PROTOCOL_GENERATED, (LXC_MONITOR_GENERATED) (ACCESS_DRIVER_GENERATED, LOCK_PROTOCOL_GENERATED): Likewise. (*_client_bodies.h): Hard-code rules to write into srcdir, as VPATH tries to build $@ locally if missing. (util/virkeymaps.h): Likewise. (lxc/lxc_monitor_dispatch.h): Likewise. (access/viraccessapi*): Likewise. (locking/lock_daemon_dispatch_stubs.h): Likewise. * daemon/Makeflie.am (DAEMON_GENERATED, remote_dispatch.h): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com> fixup DAEMON_GENERATED
2013-09-06 22:54:39 +00:00
access/viraccessapicheck.h \
access/viraccessapicheck.c \
access/viraccessapicheckqemu.h \
access/viraccessapicheckqemu.c \
access/viraccessapichecklxc.h \
access/viraccessapichecklxc.c \
$(NULL)
Auto-generate helpers for checking access control rules Extend the 'gendispatch.pl' script to be able to generate three new types of file. - 'aclheader' - defines signatures of helper APIs for doing authorization checks. There is one helper API for each API requiring an auth check. Any @acl annotations result in a method being generated with a suffix of 'EnsureACL'. If the ACL check requires examination of flags, an extra 'flags' param will be present. Some examples extern int virConnectBaselineCPUEnsureACL(void); extern int virConnectDomainEventDeregisterEnsureACL(virDomainDefPtr domain); extern int virDomainAttachDeviceFlagsEnsureACL(virDomainDefPtr domain, unsigned int flags); Any @aclfilter annotations resuilt in a method being generated with a suffix of 'CheckACL'. extern int virConnectListAllDomainsCheckACL(virDomainDefPtr domain); These are used for filtering individual objects from APIs which return a list of objects - 'aclbody' - defines the actual implementation of the methods described above. This calls into the access manager APIs. A complex example: /* Returns: -1 on error (denied==error), 0 on allowed */ int virDomainAttachDeviceFlagsEnsureACL(virConnectPtr conn, virDomainDefPtr domain, unsigned int flags) { virAccessManagerPtr mgr; int rv; if (!(mgr = virAccessManagerGetDefault())) return -1; if ((rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_WRITE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE)) == 0) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG)) == (VIR_DOMAIN_AFFECT_CONFIG)) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } virObjectUnref(mgr); return 0; } - 'aclsyms' - generates a linker script to export the APIs to drivers. Some examples virConnectBaselineCPUEnsureACL; virConnectCompareCPUEnsureACL; Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-04-18 16:49:41 +00:00
ACCESS_DRIVER_SYM_FILES = \
Auto-generate helpers for checking access control rules Extend the 'gendispatch.pl' script to be able to generate three new types of file. - 'aclheader' - defines signatures of helper APIs for doing authorization checks. There is one helper API for each API requiring an auth check. Any @acl annotations result in a method being generated with a suffix of 'EnsureACL'. If the ACL check requires examination of flags, an extra 'flags' param will be present. Some examples extern int virConnectBaselineCPUEnsureACL(void); extern int virConnectDomainEventDeregisterEnsureACL(virDomainDefPtr domain); extern int virDomainAttachDeviceFlagsEnsureACL(virDomainDefPtr domain, unsigned int flags); Any @aclfilter annotations resuilt in a method being generated with a suffix of 'CheckACL'. extern int virConnectListAllDomainsCheckACL(virDomainDefPtr domain); These are used for filtering individual objects from APIs which return a list of objects - 'aclbody' - defines the actual implementation of the methods described above. This calls into the access manager APIs. A complex example: /* Returns: -1 on error (denied==error), 0 on allowed */ int virDomainAttachDeviceFlagsEnsureACL(virConnectPtr conn, virDomainDefPtr domain, unsigned int flags) { virAccessManagerPtr mgr; int rv; if (!(mgr = virAccessManagerGetDefault())) return -1; if ((rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_WRITE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE)) == 0) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG)) == (VIR_DOMAIN_AFFECT_CONFIG)) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } virObjectUnref(mgr); return 0; } - 'aclsyms' - generates a linker script to export the APIs to drivers. Some examples virConnectBaselineCPUEnsureACL; virConnectCompareCPUEnsureACL; Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-04-18 16:49:41 +00:00
libvirt_access.syms \
libvirt_access_qemu.syms \
libvirt_access_lxc.syms
ACCESS_DRIVER_API_FILES = \
libvirt_access.xml \
libvirt_access_qemu.xml \
libvirt_access_lxc.xml
ACCESS_DRIVER_SOURCES = \
access/viraccessperm.h access/viraccessperm.c \
access/viraccessmanager.h access/viraccessmanager.c \
access/viraccessdriver.h \
access/viraccessdrivernop.h access/viraccessdrivernop.c \
access/viraccessdriverstack.h access/viraccessdriverstack.c
ACCESS_DRIVER_POLKIT_SOURCES = \
access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c
ACCESS_DRIVER_POLKIT_POLICY = \
$(srcdir)/access/org.libvirt.api.policy
CPU_SOURCES = \
cpu/cpu.h cpu/cpu.c \
cpu/cpu_x86.h cpu/cpu_x86.c cpu/cpu_x86_data.h \
cpu/cpu_s390.h cpu/cpu_s390.c \
cpu/cpu_arm.h cpu/cpu_arm.c \
cpu/cpu_ppc64.h cpu/cpu_ppc64.c \
cpu/cpu_ppc64_data.h \
cpu/cpu_map.h cpu/cpu_map.c
VMX_SOURCES = \
vmx/vmx.c vmx/vmx.h
pkgdata_DATA = cpu/cpu_map.xml
EXTRA_DIST += $(pkgdata_DATA)
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context
noinst_LTLIBRARIES += libvirt_util.la
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
libvirt_la_BUILT_LIBADD += libvirt_util.la
libvirt_util_la_SOURCES = \
$(UTIL_SOURCES)
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS) \
$(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) $(ACL_CFLAGS)
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(WIN32_EXTRA_LIBS) $(LIBXML_LIBS) \
$(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(ACL_LIBS) \
$(POLKIT_LIBS) $(GNUTLS_LIBS)
Adds CPU selection infrastructure Each driver supporting CPU selection must fill in host CPU capabilities. When filling them, drivers for hypervisors running on the same node as libvirtd can use cpuNodeData() to obtain raw CPU data. Other drivers, such as VMware, need to implement their own way of getting such data. Raw data can be decoded into virCPUDefPtr using cpuDecode() function. When implementing virConnectCompareCPU(), a hypervisor driver can just call cpuCompareXML() function with host CPU capabilities. For each guest for which a driver supports selecting CPU models, it must set the appropriate feature in guest's capabilities: virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0) Actions needed when a domain is being created depend on whether the hypervisor understands raw CPU data (currently CPUID for i686, x86_64 architectures) or symbolic names has to be used. Typical use by hypervisors which prefer CPUID (such as VMware and Xen): - convert guest CPU configuration from domain's XML into a set of raw data structures each representing one of the feature policies: cpuEncode(conn, architecture, guest_cpu_config, &forced_data, &required_data, &optional_data, &disabled_data, &forbidden_data) - create a mask or whatever the hypervisor expects to see and pass it to the hypervisor Typical use by hypervisors with symbolic model names (such as QEMU): - get raw CPU data for a computed guest CPU: cpuGuestData(conn, host_cpu, guest_cpu_config, &data) - decode raw data into virCPUDefPtr with a possible restriction on allowed model names: cpuDecode(conn, guest, data, n_allowed_models, allowed_models) - pass guest->model and guest->features to the hypervisor * src/cpu/cpu.c src/cpu/cpu.h src/cpu/cpu_generic.c src/cpu/cpu_generic.h src/cpu/cpu_map.c src/cpu/cpu_map.h src/cpu/cpu_x86.c src/cpu/cpu_x86.h src/cpu/cpu_x86_data.h * configure.in: check for CPUID instruction * src/Makefile.am: glue the new files in * src/libvirt_private.syms: add new private symbols * po/POTFILES.in: add new cpu files containing translatable strings
2009-12-18 15:02:11 +00:00
noinst_LTLIBRARIES += libvirt_cpu.la
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
Adds CPU selection infrastructure Each driver supporting CPU selection must fill in host CPU capabilities. When filling them, drivers for hypervisors running on the same node as libvirtd can use cpuNodeData() to obtain raw CPU data. Other drivers, such as VMware, need to implement their own way of getting such data. Raw data can be decoded into virCPUDefPtr using cpuDecode() function. When implementing virConnectCompareCPU(), a hypervisor driver can just call cpuCompareXML() function with host CPU capabilities. For each guest for which a driver supports selecting CPU models, it must set the appropriate feature in guest's capabilities: virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0) Actions needed when a domain is being created depend on whether the hypervisor understands raw CPU data (currently CPUID for i686, x86_64 architectures) or symbolic names has to be used. Typical use by hypervisors which prefer CPUID (such as VMware and Xen): - convert guest CPU configuration from domain's XML into a set of raw data structures each representing one of the feature policies: cpuEncode(conn, architecture, guest_cpu_config, &forced_data, &required_data, &optional_data, &disabled_data, &forbidden_data) - create a mask or whatever the hypervisor expects to see and pass it to the hypervisor Typical use by hypervisors with symbolic model names (such as QEMU): - get raw CPU data for a computed guest CPU: cpuGuestData(conn, host_cpu, guest_cpu_config, &data) - decode raw data into virCPUDefPtr with a possible restriction on allowed model names: cpuDecode(conn, guest, data, n_allowed_models, allowed_models) - pass guest->model and guest->features to the hypervisor * src/cpu/cpu.c src/cpu/cpu.h src/cpu/cpu_generic.c src/cpu/cpu_generic.h src/cpu/cpu_map.c src/cpu/cpu_map.h src/cpu/cpu_x86.c src/cpu/cpu_x86.h src/cpu/cpu_x86_data.h * configure.in: check for CPUID instruction * src/Makefile.am: glue the new files in * src/libvirt_private.syms: add new private symbols * po/POTFILES.in: add new cpu files containing translatable strings
2009-12-18 15:02:11 +00:00
libvirt_cpu_la_CFLAGS = \
-I$(srcdir)/conf $(AM_CFLAGS)
Adds CPU selection infrastructure Each driver supporting CPU selection must fill in host CPU capabilities. When filling them, drivers for hypervisors running on the same node as libvirtd can use cpuNodeData() to obtain raw CPU data. Other drivers, such as VMware, need to implement their own way of getting such data. Raw data can be decoded into virCPUDefPtr using cpuDecode() function. When implementing virConnectCompareCPU(), a hypervisor driver can just call cpuCompareXML() function with host CPU capabilities. For each guest for which a driver supports selecting CPU models, it must set the appropriate feature in guest's capabilities: virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0) Actions needed when a domain is being created depend on whether the hypervisor understands raw CPU data (currently CPUID for i686, x86_64 architectures) or symbolic names has to be used. Typical use by hypervisors which prefer CPUID (such as VMware and Xen): - convert guest CPU configuration from domain's XML into a set of raw data structures each representing one of the feature policies: cpuEncode(conn, architecture, guest_cpu_config, &forced_data, &required_data, &optional_data, &disabled_data, &forbidden_data) - create a mask or whatever the hypervisor expects to see and pass it to the hypervisor Typical use by hypervisors with symbolic model names (such as QEMU): - get raw CPU data for a computed guest CPU: cpuGuestData(conn, host_cpu, guest_cpu_config, &data) - decode raw data into virCPUDefPtr with a possible restriction on allowed model names: cpuDecode(conn, guest, data, n_allowed_models, allowed_models) - pass guest->model and guest->features to the hypervisor * src/cpu/cpu.c src/cpu/cpu.h src/cpu/cpu_generic.c src/cpu/cpu_generic.h src/cpu/cpu_map.c src/cpu/cpu_map.h src/cpu/cpu_x86.c src/cpu/cpu_x86.h src/cpu/cpu_x86_data.h * configure.in: check for CPUID instruction * src/Makefile.am: glue the new files in * src/libvirt_private.syms: add new private symbols * po/POTFILES.in: add new cpu files containing translatable strings
2009-12-18 15:02:11 +00:00
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
-I$(srcdir)/conf $(AM_CFLAGS)
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
endif WITH_VMX
noinst_LTLIBRARIES += libvirt_driver.la
libvirt_la_BUILT_LIBADD += libvirt_driver.la
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
libvirt_driver_la_CFLAGS = \
$(GNUTLS_CFLAGS) $(CURL_CFLAGS) $(XDR_CFLAGS) \
-I$(srcdir)/conf $(AM_CFLAGS)
libvirt_driver_la_LIBADD = \
$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
# All .syms files should be placed in exactly one of these three lists,
# depending on whether they are stored in git and/or used in the build.
SYM_FILES += $(USED_SYM_FILES)
USED_SYM_FILES += $(srcdir)/libvirt_private.syms
GENERATED_SYM_FILES += \
$(ACCESS_DRIVER_SYM_FILES) \
libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
libvirt_admin.syms libvirt_admin.def \
$(NULL)
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
build: fix VPATH build of remote driver Commit 073e1575 tried to set things up so that 1) generated files to be shipped in the tarball always live in srcdir, and 2) we have no files in SOURCES that depend on any other files with a literal $(srcdir) in the name, because that situation can cause confusing results for the make expansion of $@ depending on whether the file is found locally or via VPATH. But all my testing for that patch was done incrementally, where all the protocol.[ch] files had already been generated prior to the patch and were up-to-date in the srcdir, and thus I missed one case where $@ causes grief in a VPATH build from a fresh checkout: We have a pattern rule for generating remote_protocol.[ch], and what's more, the rule for protocol.c depends on protocol.h AND on the protocol.x file. The pattern for protocol.c is only satisfied via the VPATH lookup for protocol.x, and if protocol.h doesn't yet exist, the VPATH rule kicks in and we end up with a dependency on a file with $(srcdir) in the name. Based on make's rules for $@, this resulted in make building remote_protocol.h into srcdir (where we want it), then remote_protocol.c into builddir (oops, not so good for the tarball), and also causes the build to fail (the compiler can't find the .h if it lives in a different directory than the .c): CC remote/libvirt_driver_remote_la-remote_protocol.lo remote/remote_protocol.c:7:29: fatal error: remote_protocol.h: No such file or directory #include "remote_protocol.h" ^ compilation terminated. As before, the fix is to hard-code the output file to go into srcdir in spite of $@; but since this is in a pattern rule, we are forced to use $@ in the recipe, so the patch is a bit trickier than what was done in commit 073e1575. * src/Makefile.am (%protocol.c, %protocol.h): Force output to srcdir. Signed-off-by: Eric Blake <eblake@redhat.com>
2013-09-17 11:29:23 +00:00
$< $(srcdir)/$(subst $(srcdir)/,,$@)
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
build: fix VPATH build of remote driver Commit 073e1575 tried to set things up so that 1) generated files to be shipped in the tarball always live in srcdir, and 2) we have no files in SOURCES that depend on any other files with a literal $(srcdir) in the name, because that situation can cause confusing results for the make expansion of $@ depending on whether the file is found locally or via VPATH. But all my testing for that patch was done incrementally, where all the protocol.[ch] files had already been generated prior to the patch and were up-to-date in the srcdir, and thus I missed one case where $@ causes grief in a VPATH build from a fresh checkout: We have a pattern rule for generating remote_protocol.[ch], and what's more, the rule for protocol.c depends on protocol.h AND on the protocol.x file. The pattern for protocol.c is only satisfied via the VPATH lookup for protocol.x, and if protocol.h doesn't yet exist, the VPATH rule kicks in and we end up with a dependency on a file with $(srcdir) in the name. Based on make's rules for $@, this resulted in make building remote_protocol.h into srcdir (where we want it), then remote_protocol.c into builddir (oops, not so good for the tarball), and also causes the build to fail (the compiler can't find the .h if it lives in a different directory than the .c): CC remote/libvirt_driver_remote_la-remote_protocol.lo remote/remote_protocol.c:7:29: fatal error: remote_protocol.h: No such file or directory #include "remote_protocol.h" ^ compilation terminated. As before, the fix is to hard-code the output file to go into srcdir in spite of $@; but since this is in a pattern rule, we are forced to use $@ in the recipe, so the patch is a bit trickier than what was done in commit 073e1575. * src/Makefile.am (%protocol.c, %protocol.h): Force output to srcdir. Signed-off-by: Eric Blake <eblake@redhat.com>
2013-09-17 11:29:23 +00:00
$< $(srcdir)/$(subst $(srcdir)/,,$@)
libvirt_security_manager_la_SOURCES = $(SECURITY_DRIVER_SOURCES)
noinst_LTLIBRARIES += libvirt_security_manager.la
libvirt_la_BUILT_LIBADD += libvirt_security_manager.la
libvirt_security_manager_la_CFLAGS = \
-I$(srcdir)/conf $(AM_CFLAGS)
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
if WITH_SECDRIVER_SELINUX
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
endif WITH_SECDRIVER_SELINUX
if WITH_SECDRIVER_APPARMOR
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
endif WITH_SECDRIVER_APPARMOR
libvirt_driver_access_la_SOURCES = \
$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
-I$(srcdir)/conf $(AM_CFLAGS)
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =
EXTRA_DIST += access/genpolkit.pl
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
$(srcdir)/access/genpolkit.pl Makefile.am
$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)
polkitactiondir = $(datadir)/polkit-1/actions
if WITH_LIBVIRTD
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
endif WITH_LIBVIRTD
CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
else ! WITH_POLKIT1
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
endif ! WITH_POLKIT1
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
Auto-generate helpers for checking access control rules Extend the 'gendispatch.pl' script to be able to generate three new types of file. - 'aclheader' - defines signatures of helper APIs for doing authorization checks. There is one helper API for each API requiring an auth check. Any @acl annotations result in a method being generated with a suffix of 'EnsureACL'. If the ACL check requires examination of flags, an extra 'flags' param will be present. Some examples extern int virConnectBaselineCPUEnsureACL(void); extern int virConnectDomainEventDeregisterEnsureACL(virDomainDefPtr domain); extern int virDomainAttachDeviceFlagsEnsureACL(virDomainDefPtr domain, unsigned int flags); Any @aclfilter annotations resuilt in a method being generated with a suffix of 'CheckACL'. extern int virConnectListAllDomainsCheckACL(virDomainDefPtr domain); These are used for filtering individual objects from APIs which return a list of objects - 'aclbody' - defines the actual implementation of the methods described above. This calls into the access manager APIs. A complex example: /* Returns: -1 on error (denied==error), 0 on allowed */ int virDomainAttachDeviceFlagsEnsureACL(virConnectPtr conn, virDomainDefPtr domain, unsigned int flags) { virAccessManagerPtr mgr; int rv; if (!(mgr = virAccessManagerGetDefault())) return -1; if ((rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_WRITE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE)) == 0) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG)) == (VIR_DOMAIN_AFFECT_CONFIG)) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } virObjectUnref(mgr); return 0; } - 'aclsyms' - generates a linker script to export the APIs to drivers. Some examples virConnectBaselineCPUEnsureACL; virConnectCompareCPUEnsureACL; Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-04-18 16:49:41 +00:00
libvirt_access.syms: $(srcdir)/rpc/gendispatch.pl \
$(REMOTE_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclsym \
remote REMOTE $(REMOTE_PROTOCOL) > $@
libvirt_access_qemu.syms: $(srcdir)/rpc/gendispatch.pl \
$(QEMU_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclsym \
qemu QEMU $(QEMU_PROTOCOL) > $@
libvirt_access_lxc.syms: $(srcdir)/rpc/gendispatch.pl \
$(LXC_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclsym \
lxc LXC $(LXC_PROTOCOL) > $@
libvirt_access.xml: $(srcdir)/rpc/gendispatch.pl \
$(REMOTE_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \
remote REMOTE $(REMOTE_PROTOCOL) > $@
libvirt_access_qemu.xml: $(srcdir)/rpc/gendispatch.pl \
$(QEMU_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \
qemu QEMU $(QEMU_PROTOCOL) > $@
libvirt_access_lxc.xml: $(srcdir)/rpc/gendispatch.pl \
$(LXC_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \
lxc LXC $(LXC_PROTOCOL) > $@
build: avoid $(srcdir) in *_SOURCES Trying to enable automake's subdir-objects option resulted in the creation of literal directories such as src/$(srcdir)/remote/. I traced this to the fact that we had used a literal $(srcdir) in a location that later fed an automake *_SOURCES variable. This has also been reported as an automake bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928 but it's better to fix our code than to wait for an automake fix. Some things to remember that affect VPATH builds, and where an in-tree build is blissfully unaware of the issues: if a VPATH build fails to find a file that was used as a prereq of any other target, then the rule for that file will expand $@ to prefer the current build dir (bad because a VPATH build on a fresh checkout will then stick $@ in the current directory instead of the desired srcdir); conversely, if a VPATH build finds the file in srcdir but decides it needs to be rebuilt, then the rule for that file will expand $@ to include the directory where it was found out-of-date (bad for an explicit listing of $(srcdir)/$@ because an incremental VPATH build will then expand srcdir twice). As we want these files to go into srcdir unconditionally, we have to massage or avoid $@ for any recipe that involves one of these files. Therefore, this patch removes all uses of $(srcdir) from any generated file name that later feeds a *_SOURCES variable, and then rewrites all the recipes to generate those files to hard-code their creation into srcdir without the use of $@. * src/Makefile.am (REMOTE_DRIVER_GENERATED): Drop $(srcdir); VPATH builds know how to find the files, and automake subdir-objects fails with it in place. (LXC_MONITOR_PROTOCOL_GENERATED, (LXC_MONITOR_GENERATED) (ACCESS_DRIVER_GENERATED, LOCK_PROTOCOL_GENERATED): Likewise. (*_client_bodies.h): Hard-code rules to write into srcdir, as VPATH tries to build $@ locally if missing. (util/virkeymaps.h): Likewise. (lxc/lxc_monitor_dispatch.h): Likewise. (access/viraccessapi*): Likewise. (locking/lock_daemon_dispatch_stubs.h): Likewise. * daemon/Makeflie.am (DAEMON_GENERATED, remote_dispatch.h): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com> fixup DAEMON_GENERATED
2013-09-06 22:54:39 +00:00
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
Auto-generate helpers for checking access control rules Extend the 'gendispatch.pl' script to be able to generate three new types of file. - 'aclheader' - defines signatures of helper APIs for doing authorization checks. There is one helper API for each API requiring an auth check. Any @acl annotations result in a method being generated with a suffix of 'EnsureACL'. If the ACL check requires examination of flags, an extra 'flags' param will be present. Some examples extern int virConnectBaselineCPUEnsureACL(void); extern int virConnectDomainEventDeregisterEnsureACL(virDomainDefPtr domain); extern int virDomainAttachDeviceFlagsEnsureACL(virDomainDefPtr domain, unsigned int flags); Any @aclfilter annotations resuilt in a method being generated with a suffix of 'CheckACL'. extern int virConnectListAllDomainsCheckACL(virDomainDefPtr domain); These are used for filtering individual objects from APIs which return a list of objects - 'aclbody' - defines the actual implementation of the methods described above. This calls into the access manager APIs. A complex example: /* Returns: -1 on error (denied==error), 0 on allowed */ int virDomainAttachDeviceFlagsEnsureACL(virConnectPtr conn, virDomainDefPtr domain, unsigned int flags) { virAccessManagerPtr mgr; int rv; if (!(mgr = virAccessManagerGetDefault())) return -1; if ((rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_WRITE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE)) == 0) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG)) == (VIR_DOMAIN_AFFECT_CONFIG)) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } virObjectUnref(mgr); return 0; } - 'aclsyms' - generates a linker script to export the APIs to drivers. Some examples virConnectBaselineCPUEnsureACL; virConnectCompareCPUEnsureACL; Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-04-18 16:49:41 +00:00
$(REMOTE_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
build: avoid $(srcdir) in *_SOURCES Trying to enable automake's subdir-objects option resulted in the creation of literal directories such as src/$(srcdir)/remote/. I traced this to the fact that we had used a literal $(srcdir) in a location that later fed an automake *_SOURCES variable. This has also been reported as an automake bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928 but it's better to fix our code than to wait for an automake fix. Some things to remember that affect VPATH builds, and where an in-tree build is blissfully unaware of the issues: if a VPATH build fails to find a file that was used as a prereq of any other target, then the rule for that file will expand $@ to prefer the current build dir (bad because a VPATH build on a fresh checkout will then stick $@ in the current directory instead of the desired srcdir); conversely, if a VPATH build finds the file in srcdir but decides it needs to be rebuilt, then the rule for that file will expand $@ to include the directory where it was found out-of-date (bad for an explicit listing of $(srcdir)/$@ because an incremental VPATH build will then expand srcdir twice). As we want these files to go into srcdir unconditionally, we have to massage or avoid $@ for any recipe that involves one of these files. Therefore, this patch removes all uses of $(srcdir) from any generated file name that later feeds a *_SOURCES variable, and then rewrites all the recipes to generate those files to hard-code their creation into srcdir without the use of $@. * src/Makefile.am (REMOTE_DRIVER_GENERATED): Drop $(srcdir); VPATH builds know how to find the files, and automake subdir-objects fails with it in place. (LXC_MONITOR_PROTOCOL_GENERATED, (LXC_MONITOR_GENERATED) (ACCESS_DRIVER_GENERATED, LOCK_PROTOCOL_GENERATED): Likewise. (*_client_bodies.h): Hard-code rules to write into srcdir, as VPATH tries to build $@ locally if missing. (util/virkeymaps.h): Likewise. (lxc/lxc_monitor_dispatch.h): Likewise. (access/viraccessapi*): Likewise. (locking/lock_daemon_dispatch_stubs.h): Likewise. * daemon/Makeflie.am (DAEMON_GENERATED, remote_dispatch.h): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com> fixup DAEMON_GENERATED
2013-09-06 22:54:39 +00:00
remote REMOTE $(REMOTE_PROTOCOL) \
> $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
Auto-generate helpers for checking access control rules Extend the 'gendispatch.pl' script to be able to generate three new types of file. - 'aclheader' - defines signatures of helper APIs for doing authorization checks. There is one helper API for each API requiring an auth check. Any @acl annotations result in a method being generated with a suffix of 'EnsureACL'. If the ACL check requires examination of flags, an extra 'flags' param will be present. Some examples extern int virConnectBaselineCPUEnsureACL(void); extern int virConnectDomainEventDeregisterEnsureACL(virDomainDefPtr domain); extern int virDomainAttachDeviceFlagsEnsureACL(virDomainDefPtr domain, unsigned int flags); Any @aclfilter annotations resuilt in a method being generated with a suffix of 'CheckACL'. extern int virConnectListAllDomainsCheckACL(virDomainDefPtr domain); These are used for filtering individual objects from APIs which return a list of objects - 'aclbody' - defines the actual implementation of the methods described above. This calls into the access manager APIs. A complex example: /* Returns: -1 on error (denied==error), 0 on allowed */ int virDomainAttachDeviceFlagsEnsureACL(virConnectPtr conn, virDomainDefPtr domain, unsigned int flags) { virAccessManagerPtr mgr; int rv; if (!(mgr = virAccessManagerGetDefault())) return -1; if ((rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_WRITE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE)) == 0) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG)) == (VIR_DOMAIN_AFFECT_CONFIG)) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } virObjectUnref(mgr); return 0; } - 'aclsyms' - generates a linker script to export the APIs to drivers. Some examples virConnectBaselineCPUEnsureACL; virConnectCompareCPUEnsureACL; Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-04-18 16:49:41 +00:00
$(REMOTE_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
build: avoid $(srcdir) in *_SOURCES Trying to enable automake's subdir-objects option resulted in the creation of literal directories such as src/$(srcdir)/remote/. I traced this to the fact that we had used a literal $(srcdir) in a location that later fed an automake *_SOURCES variable. This has also been reported as an automake bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928 but it's better to fix our code than to wait for an automake fix. Some things to remember that affect VPATH builds, and where an in-tree build is blissfully unaware of the issues: if a VPATH build fails to find a file that was used as a prereq of any other target, then the rule for that file will expand $@ to prefer the current build dir (bad because a VPATH build on a fresh checkout will then stick $@ in the current directory instead of the desired srcdir); conversely, if a VPATH build finds the file in srcdir but decides it needs to be rebuilt, then the rule for that file will expand $@ to include the directory where it was found out-of-date (bad for an explicit listing of $(srcdir)/$@ because an incremental VPATH build will then expand srcdir twice). As we want these files to go into srcdir unconditionally, we have to massage or avoid $@ for any recipe that involves one of these files. Therefore, this patch removes all uses of $(srcdir) from any generated file name that later feeds a *_SOURCES variable, and then rewrites all the recipes to generate those files to hard-code their creation into srcdir without the use of $@. * src/Makefile.am (REMOTE_DRIVER_GENERATED): Drop $(srcdir); VPATH builds know how to find the files, and automake subdir-objects fails with it in place. (LXC_MONITOR_PROTOCOL_GENERATED, (LXC_MONITOR_GENERATED) (ACCESS_DRIVER_GENERATED, LOCK_PROTOCOL_GENERATED): Likewise. (*_client_bodies.h): Hard-code rules to write into srcdir, as VPATH tries to build $@ locally if missing. (util/virkeymaps.h): Likewise. (lxc/lxc_monitor_dispatch.h): Likewise. (access/viraccessapi*): Likewise. (locking/lock_daemon_dispatch_stubs.h): Likewise. * daemon/Makeflie.am (DAEMON_GENERATED, remote_dispatch.h): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com> fixup DAEMON_GENERATED
2013-09-06 22:54:39 +00:00
remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
> $(srcdir)/access/viraccessapicheck.c
Auto-generate helpers for checking access control rules Extend the 'gendispatch.pl' script to be able to generate three new types of file. - 'aclheader' - defines signatures of helper APIs for doing authorization checks. There is one helper API for each API requiring an auth check. Any @acl annotations result in a method being generated with a suffix of 'EnsureACL'. If the ACL check requires examination of flags, an extra 'flags' param will be present. Some examples extern int virConnectBaselineCPUEnsureACL(void); extern int virConnectDomainEventDeregisterEnsureACL(virDomainDefPtr domain); extern int virDomainAttachDeviceFlagsEnsureACL(virDomainDefPtr domain, unsigned int flags); Any @aclfilter annotations resuilt in a method being generated with a suffix of 'CheckACL'. extern int virConnectListAllDomainsCheckACL(virDomainDefPtr domain); These are used for filtering individual objects from APIs which return a list of objects - 'aclbody' - defines the actual implementation of the methods described above. This calls into the access manager APIs. A complex example: /* Returns: -1 on error (denied==error), 0 on allowed */ int virDomainAttachDeviceFlagsEnsureACL(virConnectPtr conn, virDomainDefPtr domain, unsigned int flags) { virAccessManagerPtr mgr; int rv; if (!(mgr = virAccessManagerGetDefault())) return -1; if ((rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_WRITE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE)) == 0) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG)) == (VIR_DOMAIN_AFFECT_CONFIG)) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } virObjectUnref(mgr); return 0; } - 'aclsyms' - generates a linker script to export the APIs to drivers. Some examples virConnectBaselineCPUEnsureACL; virConnectCompareCPUEnsureACL; Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-04-18 16:49:41 +00:00
build: avoid $(srcdir) in *_SOURCES Trying to enable automake's subdir-objects option resulted in the creation of literal directories such as src/$(srcdir)/remote/. I traced this to the fact that we had used a literal $(srcdir) in a location that later fed an automake *_SOURCES variable. This has also been reported as an automake bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928 but it's better to fix our code than to wait for an automake fix. Some things to remember that affect VPATH builds, and where an in-tree build is blissfully unaware of the issues: if a VPATH build fails to find a file that was used as a prereq of any other target, then the rule for that file will expand $@ to prefer the current build dir (bad because a VPATH build on a fresh checkout will then stick $@ in the current directory instead of the desired srcdir); conversely, if a VPATH build finds the file in srcdir but decides it needs to be rebuilt, then the rule for that file will expand $@ to include the directory where it was found out-of-date (bad for an explicit listing of $(srcdir)/$@ because an incremental VPATH build will then expand srcdir twice). As we want these files to go into srcdir unconditionally, we have to massage or avoid $@ for any recipe that involves one of these files. Therefore, this patch removes all uses of $(srcdir) from any generated file name that later feeds a *_SOURCES variable, and then rewrites all the recipes to generate those files to hard-code their creation into srcdir without the use of $@. * src/Makefile.am (REMOTE_DRIVER_GENERATED): Drop $(srcdir); VPATH builds know how to find the files, and automake subdir-objects fails with it in place. (LXC_MONITOR_PROTOCOL_GENERATED, (LXC_MONITOR_GENERATED) (ACCESS_DRIVER_GENERATED, LOCK_PROTOCOL_GENERATED): Likewise. (*_client_bodies.h): Hard-code rules to write into srcdir, as VPATH tries to build $@ locally if missing. (util/virkeymaps.h): Likewise. (lxc/lxc_monitor_dispatch.h): Likewise. (access/viraccessapi*): Likewise. (locking/lock_daemon_dispatch_stubs.h): Likewise. * daemon/Makeflie.am (DAEMON_GENERATED, remote_dispatch.h): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com> fixup DAEMON_GENERATED
2013-09-06 22:54:39 +00:00
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
Auto-generate helpers for checking access control rules Extend the 'gendispatch.pl' script to be able to generate three new types of file. - 'aclheader' - defines signatures of helper APIs for doing authorization checks. There is one helper API for each API requiring an auth check. Any @acl annotations result in a method being generated with a suffix of 'EnsureACL'. If the ACL check requires examination of flags, an extra 'flags' param will be present. Some examples extern int virConnectBaselineCPUEnsureACL(void); extern int virConnectDomainEventDeregisterEnsureACL(virDomainDefPtr domain); extern int virDomainAttachDeviceFlagsEnsureACL(virDomainDefPtr domain, unsigned int flags); Any @aclfilter annotations resuilt in a method being generated with a suffix of 'CheckACL'. extern int virConnectListAllDomainsCheckACL(virDomainDefPtr domain); These are used for filtering individual objects from APIs which return a list of objects - 'aclbody' - defines the actual implementation of the methods described above. This calls into the access manager APIs. A complex example: /* Returns: -1 on error (denied==error), 0 on allowed */ int virDomainAttachDeviceFlagsEnsureACL(virConnectPtr conn, virDomainDefPtr domain, unsigned int flags) { virAccessManagerPtr mgr; int rv; if (!(mgr = virAccessManagerGetDefault())) return -1; if ((rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_WRITE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE)) == 0) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG)) == (VIR_DOMAIN_AFFECT_CONFIG)) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } virObjectUnref(mgr); return 0; } - 'aclsyms' - generates a linker script to export the APIs to drivers. Some examples virConnectBaselineCPUEnsureACL; virConnectCompareCPUEnsureACL; Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-04-18 16:49:41 +00:00
$(QEMU_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
build: avoid $(srcdir) in *_SOURCES Trying to enable automake's subdir-objects option resulted in the creation of literal directories such as src/$(srcdir)/remote/. I traced this to the fact that we had used a literal $(srcdir) in a location that later fed an automake *_SOURCES variable. This has also been reported as an automake bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928 but it's better to fix our code than to wait for an automake fix. Some things to remember that affect VPATH builds, and where an in-tree build is blissfully unaware of the issues: if a VPATH build fails to find a file that was used as a prereq of any other target, then the rule for that file will expand $@ to prefer the current build dir (bad because a VPATH build on a fresh checkout will then stick $@ in the current directory instead of the desired srcdir); conversely, if a VPATH build finds the file in srcdir but decides it needs to be rebuilt, then the rule for that file will expand $@ to include the directory where it was found out-of-date (bad for an explicit listing of $(srcdir)/$@ because an incremental VPATH build will then expand srcdir twice). As we want these files to go into srcdir unconditionally, we have to massage or avoid $@ for any recipe that involves one of these files. Therefore, this patch removes all uses of $(srcdir) from any generated file name that later feeds a *_SOURCES variable, and then rewrites all the recipes to generate those files to hard-code their creation into srcdir without the use of $@. * src/Makefile.am (REMOTE_DRIVER_GENERATED): Drop $(srcdir); VPATH builds know how to find the files, and automake subdir-objects fails with it in place. (LXC_MONITOR_PROTOCOL_GENERATED, (LXC_MONITOR_GENERATED) (ACCESS_DRIVER_GENERATED, LOCK_PROTOCOL_GENERATED): Likewise. (*_client_bodies.h): Hard-code rules to write into srcdir, as VPATH tries to build $@ locally if missing. (util/virkeymaps.h): Likewise. (lxc/lxc_monitor_dispatch.h): Likewise. (access/viraccessapi*): Likewise. (locking/lock_daemon_dispatch_stubs.h): Likewise. * daemon/Makeflie.am (DAEMON_GENERATED, remote_dispatch.h): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com> fixup DAEMON_GENERATED
2013-09-06 22:54:39 +00:00
qemu QEMU $(QEMU_PROTOCOL) \
> $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
Auto-generate helpers for checking access control rules Extend the 'gendispatch.pl' script to be able to generate three new types of file. - 'aclheader' - defines signatures of helper APIs for doing authorization checks. There is one helper API for each API requiring an auth check. Any @acl annotations result in a method being generated with a suffix of 'EnsureACL'. If the ACL check requires examination of flags, an extra 'flags' param will be present. Some examples extern int virConnectBaselineCPUEnsureACL(void); extern int virConnectDomainEventDeregisterEnsureACL(virDomainDefPtr domain); extern int virDomainAttachDeviceFlagsEnsureACL(virDomainDefPtr domain, unsigned int flags); Any @aclfilter annotations resuilt in a method being generated with a suffix of 'CheckACL'. extern int virConnectListAllDomainsCheckACL(virDomainDefPtr domain); These are used for filtering individual objects from APIs which return a list of objects - 'aclbody' - defines the actual implementation of the methods described above. This calls into the access manager APIs. A complex example: /* Returns: -1 on error (denied==error), 0 on allowed */ int virDomainAttachDeviceFlagsEnsureACL(virConnectPtr conn, virDomainDefPtr domain, unsigned int flags) { virAccessManagerPtr mgr; int rv; if (!(mgr = virAccessManagerGetDefault())) return -1; if ((rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_WRITE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE)) == 0) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG)) == (VIR_DOMAIN_AFFECT_CONFIG)) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } virObjectUnref(mgr); return 0; } - 'aclsyms' - generates a linker script to export the APIs to drivers. Some examples virConnectBaselineCPUEnsureACL; virConnectCompareCPUEnsureACL; Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-04-18 16:49:41 +00:00
$(QEMU_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
build: avoid $(srcdir) in *_SOURCES Trying to enable automake's subdir-objects option resulted in the creation of literal directories such as src/$(srcdir)/remote/. I traced this to the fact that we had used a literal $(srcdir) in a location that later fed an automake *_SOURCES variable. This has also been reported as an automake bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928 but it's better to fix our code than to wait for an automake fix. Some things to remember that affect VPATH builds, and where an in-tree build is blissfully unaware of the issues: if a VPATH build fails to find a file that was used as a prereq of any other target, then the rule for that file will expand $@ to prefer the current build dir (bad because a VPATH build on a fresh checkout will then stick $@ in the current directory instead of the desired srcdir); conversely, if a VPATH build finds the file in srcdir but decides it needs to be rebuilt, then the rule for that file will expand $@ to include the directory where it was found out-of-date (bad for an explicit listing of $(srcdir)/$@ because an incremental VPATH build will then expand srcdir twice). As we want these files to go into srcdir unconditionally, we have to massage or avoid $@ for any recipe that involves one of these files. Therefore, this patch removes all uses of $(srcdir) from any generated file name that later feeds a *_SOURCES variable, and then rewrites all the recipes to generate those files to hard-code their creation into srcdir without the use of $@. * src/Makefile.am (REMOTE_DRIVER_GENERATED): Drop $(srcdir); VPATH builds know how to find the files, and automake subdir-objects fails with it in place. (LXC_MONITOR_PROTOCOL_GENERATED, (LXC_MONITOR_GENERATED) (ACCESS_DRIVER_GENERATED, LOCK_PROTOCOL_GENERATED): Likewise. (*_client_bodies.h): Hard-code rules to write into srcdir, as VPATH tries to build $@ locally if missing. (util/virkeymaps.h): Likewise. (lxc/lxc_monitor_dispatch.h): Likewise. (access/viraccessapi*): Likewise. (locking/lock_daemon_dispatch_stubs.h): Likewise. * daemon/Makeflie.am (DAEMON_GENERATED, remote_dispatch.h): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com> fixup DAEMON_GENERATED
2013-09-06 22:54:39 +00:00
qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
> $(srcdir)/access/viraccessapicheckqemu.c
Auto-generate helpers for checking access control rules Extend the 'gendispatch.pl' script to be able to generate three new types of file. - 'aclheader' - defines signatures of helper APIs for doing authorization checks. There is one helper API for each API requiring an auth check. Any @acl annotations result in a method being generated with a suffix of 'EnsureACL'. If the ACL check requires examination of flags, an extra 'flags' param will be present. Some examples extern int virConnectBaselineCPUEnsureACL(void); extern int virConnectDomainEventDeregisterEnsureACL(virDomainDefPtr domain); extern int virDomainAttachDeviceFlagsEnsureACL(virDomainDefPtr domain, unsigned int flags); Any @aclfilter annotations resuilt in a method being generated with a suffix of 'CheckACL'. extern int virConnectListAllDomainsCheckACL(virDomainDefPtr domain); These are used for filtering individual objects from APIs which return a list of objects - 'aclbody' - defines the actual implementation of the methods described above. This calls into the access manager APIs. A complex example: /* Returns: -1 on error (denied==error), 0 on allowed */ int virDomainAttachDeviceFlagsEnsureACL(virConnectPtr conn, virDomainDefPtr domain, unsigned int flags) { virAccessManagerPtr mgr; int rv; if (!(mgr = virAccessManagerGetDefault())) return -1; if ((rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_WRITE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE)) == 0) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG)) == (VIR_DOMAIN_AFFECT_CONFIG)) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } virObjectUnref(mgr); return 0; } - 'aclsyms' - generates a linker script to export the APIs to drivers. Some examples virConnectBaselineCPUEnsureACL; virConnectCompareCPUEnsureACL; Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-04-18 16:49:41 +00:00
build: avoid $(srcdir) in *_SOURCES Trying to enable automake's subdir-objects option resulted in the creation of literal directories such as src/$(srcdir)/remote/. I traced this to the fact that we had used a literal $(srcdir) in a location that later fed an automake *_SOURCES variable. This has also been reported as an automake bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928 but it's better to fix our code than to wait for an automake fix. Some things to remember that affect VPATH builds, and where an in-tree build is blissfully unaware of the issues: if a VPATH build fails to find a file that was used as a prereq of any other target, then the rule for that file will expand $@ to prefer the current build dir (bad because a VPATH build on a fresh checkout will then stick $@ in the current directory instead of the desired srcdir); conversely, if a VPATH build finds the file in srcdir but decides it needs to be rebuilt, then the rule for that file will expand $@ to include the directory where it was found out-of-date (bad for an explicit listing of $(srcdir)/$@ because an incremental VPATH build will then expand srcdir twice). As we want these files to go into srcdir unconditionally, we have to massage or avoid $@ for any recipe that involves one of these files. Therefore, this patch removes all uses of $(srcdir) from any generated file name that later feeds a *_SOURCES variable, and then rewrites all the recipes to generate those files to hard-code their creation into srcdir without the use of $@. * src/Makefile.am (REMOTE_DRIVER_GENERATED): Drop $(srcdir); VPATH builds know how to find the files, and automake subdir-objects fails with it in place. (LXC_MONITOR_PROTOCOL_GENERATED, (LXC_MONITOR_GENERATED) (ACCESS_DRIVER_GENERATED, LOCK_PROTOCOL_GENERATED): Likewise. (*_client_bodies.h): Hard-code rules to write into srcdir, as VPATH tries to build $@ locally if missing. (util/virkeymaps.h): Likewise. (lxc/lxc_monitor_dispatch.h): Likewise. (access/viraccessapi*): Likewise. (locking/lock_daemon_dispatch_stubs.h): Likewise. * daemon/Makeflie.am (DAEMON_GENERATED, remote_dispatch.h): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com> fixup DAEMON_GENERATED
2013-09-06 22:54:39 +00:00
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
Auto-generate helpers for checking access control rules Extend the 'gendispatch.pl' script to be able to generate three new types of file. - 'aclheader' - defines signatures of helper APIs for doing authorization checks. There is one helper API for each API requiring an auth check. Any @acl annotations result in a method being generated with a suffix of 'EnsureACL'. If the ACL check requires examination of flags, an extra 'flags' param will be present. Some examples extern int virConnectBaselineCPUEnsureACL(void); extern int virConnectDomainEventDeregisterEnsureACL(virDomainDefPtr domain); extern int virDomainAttachDeviceFlagsEnsureACL(virDomainDefPtr domain, unsigned int flags); Any @aclfilter annotations resuilt in a method being generated with a suffix of 'CheckACL'. extern int virConnectListAllDomainsCheckACL(virDomainDefPtr domain); These are used for filtering individual objects from APIs which return a list of objects - 'aclbody' - defines the actual implementation of the methods described above. This calls into the access manager APIs. A complex example: /* Returns: -1 on error (denied==error), 0 on allowed */ int virDomainAttachDeviceFlagsEnsureACL(virConnectPtr conn, virDomainDefPtr domain, unsigned int flags) { virAccessManagerPtr mgr; int rv; if (!(mgr = virAccessManagerGetDefault())) return -1; if ((rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_WRITE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE)) == 0) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG)) == (VIR_DOMAIN_AFFECT_CONFIG)) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } virObjectUnref(mgr); return 0; } - 'aclsyms' - generates a linker script to export the APIs to drivers. Some examples virConnectBaselineCPUEnsureACL; virConnectCompareCPUEnsureACL; Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-04-18 16:49:41 +00:00
$(LXC_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
build: avoid $(srcdir) in *_SOURCES Trying to enable automake's subdir-objects option resulted in the creation of literal directories such as src/$(srcdir)/remote/. I traced this to the fact that we had used a literal $(srcdir) in a location that later fed an automake *_SOURCES variable. This has also been reported as an automake bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928 but it's better to fix our code than to wait for an automake fix. Some things to remember that affect VPATH builds, and where an in-tree build is blissfully unaware of the issues: if a VPATH build fails to find a file that was used as a prereq of any other target, then the rule for that file will expand $@ to prefer the current build dir (bad because a VPATH build on a fresh checkout will then stick $@ in the current directory instead of the desired srcdir); conversely, if a VPATH build finds the file in srcdir but decides it needs to be rebuilt, then the rule for that file will expand $@ to include the directory where it was found out-of-date (bad for an explicit listing of $(srcdir)/$@ because an incremental VPATH build will then expand srcdir twice). As we want these files to go into srcdir unconditionally, we have to massage or avoid $@ for any recipe that involves one of these files. Therefore, this patch removes all uses of $(srcdir) from any generated file name that later feeds a *_SOURCES variable, and then rewrites all the recipes to generate those files to hard-code their creation into srcdir without the use of $@. * src/Makefile.am (REMOTE_DRIVER_GENERATED): Drop $(srcdir); VPATH builds know how to find the files, and automake subdir-objects fails with it in place. (LXC_MONITOR_PROTOCOL_GENERATED, (LXC_MONITOR_GENERATED) (ACCESS_DRIVER_GENERATED, LOCK_PROTOCOL_GENERATED): Likewise. (*_client_bodies.h): Hard-code rules to write into srcdir, as VPATH tries to build $@ locally if missing. (util/virkeymaps.h): Likewise. (lxc/lxc_monitor_dispatch.h): Likewise. (access/viraccessapi*): Likewise. (locking/lock_daemon_dispatch_stubs.h): Likewise. * daemon/Makeflie.am (DAEMON_GENERATED, remote_dispatch.h): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com> fixup DAEMON_GENERATED
2013-09-06 22:54:39 +00:00
lxc LXC $(LXC_PROTOCOL) \
> $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
Auto-generate helpers for checking access control rules Extend the 'gendispatch.pl' script to be able to generate three new types of file. - 'aclheader' - defines signatures of helper APIs for doing authorization checks. There is one helper API for each API requiring an auth check. Any @acl annotations result in a method being generated with a suffix of 'EnsureACL'. If the ACL check requires examination of flags, an extra 'flags' param will be present. Some examples extern int virConnectBaselineCPUEnsureACL(void); extern int virConnectDomainEventDeregisterEnsureACL(virDomainDefPtr domain); extern int virDomainAttachDeviceFlagsEnsureACL(virDomainDefPtr domain, unsigned int flags); Any @aclfilter annotations resuilt in a method being generated with a suffix of 'CheckACL'. extern int virConnectListAllDomainsCheckACL(virDomainDefPtr domain); These are used for filtering individual objects from APIs which return a list of objects - 'aclbody' - defines the actual implementation of the methods described above. This calls into the access manager APIs. A complex example: /* Returns: -1 on error (denied==error), 0 on allowed */ int virDomainAttachDeviceFlagsEnsureACL(virConnectPtr conn, virDomainDefPtr domain, unsigned int flags) { virAccessManagerPtr mgr; int rv; if (!(mgr = virAccessManagerGetDefault())) return -1; if ((rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_WRITE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE)) == 0) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG)) == (VIR_DOMAIN_AFFECT_CONFIG)) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } virObjectUnref(mgr); return 0; } - 'aclsyms' - generates a linker script to export the APIs to drivers. Some examples virConnectBaselineCPUEnsureACL; virConnectCompareCPUEnsureACL; Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-04-18 16:49:41 +00:00
$(LXC_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
build: avoid $(srcdir) in *_SOURCES Trying to enable automake's subdir-objects option resulted in the creation of literal directories such as src/$(srcdir)/remote/. I traced this to the fact that we had used a literal $(srcdir) in a location that later fed an automake *_SOURCES variable. This has also been reported as an automake bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928 but it's better to fix our code than to wait for an automake fix. Some things to remember that affect VPATH builds, and where an in-tree build is blissfully unaware of the issues: if a VPATH build fails to find a file that was used as a prereq of any other target, then the rule for that file will expand $@ to prefer the current build dir (bad because a VPATH build on a fresh checkout will then stick $@ in the current directory instead of the desired srcdir); conversely, if a VPATH build finds the file in srcdir but decides it needs to be rebuilt, then the rule for that file will expand $@ to include the directory where it was found out-of-date (bad for an explicit listing of $(srcdir)/$@ because an incremental VPATH build will then expand srcdir twice). As we want these files to go into srcdir unconditionally, we have to massage or avoid $@ for any recipe that involves one of these files. Therefore, this patch removes all uses of $(srcdir) from any generated file name that later feeds a *_SOURCES variable, and then rewrites all the recipes to generate those files to hard-code their creation into srcdir without the use of $@. * src/Makefile.am (REMOTE_DRIVER_GENERATED): Drop $(srcdir); VPATH builds know how to find the files, and automake subdir-objects fails with it in place. (LXC_MONITOR_PROTOCOL_GENERATED, (LXC_MONITOR_GENERATED) (ACCESS_DRIVER_GENERATED, LOCK_PROTOCOL_GENERATED): Likewise. (*_client_bodies.h): Hard-code rules to write into srcdir, as VPATH tries to build $@ locally if missing. (util/virkeymaps.h): Likewise. (lxc/lxc_monitor_dispatch.h): Likewise. (access/viraccessapi*): Likewise. (locking/lock_daemon_dispatch_stubs.h): Likewise. * daemon/Makeflie.am (DAEMON_GENERATED, remote_dispatch.h): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com> fixup DAEMON_GENERATED
2013-09-06 22:54:39 +00:00
lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
> $(srcdir)/access/viraccessapichecklxc.c
Auto-generate helpers for checking access control rules Extend the 'gendispatch.pl' script to be able to generate three new types of file. - 'aclheader' - defines signatures of helper APIs for doing authorization checks. There is one helper API for each API requiring an auth check. Any @acl annotations result in a method being generated with a suffix of 'EnsureACL'. If the ACL check requires examination of flags, an extra 'flags' param will be present. Some examples extern int virConnectBaselineCPUEnsureACL(void); extern int virConnectDomainEventDeregisterEnsureACL(virDomainDefPtr domain); extern int virDomainAttachDeviceFlagsEnsureACL(virDomainDefPtr domain, unsigned int flags); Any @aclfilter annotations resuilt in a method being generated with a suffix of 'CheckACL'. extern int virConnectListAllDomainsCheckACL(virDomainDefPtr domain); These are used for filtering individual objects from APIs which return a list of objects - 'aclbody' - defines the actual implementation of the methods described above. This calls into the access manager APIs. A complex example: /* Returns: -1 on error (denied==error), 0 on allowed */ int virDomainAttachDeviceFlagsEnsureACL(virConnectPtr conn, virDomainDefPtr domain, unsigned int flags) { virAccessManagerPtr mgr; int rv; if (!(mgr = virAccessManagerGetDefault())) return -1; if ((rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_WRITE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE)) == 0) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG)) == (VIR_DOMAIN_AFFECT_CONFIG)) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } virObjectUnref(mgr); return 0; } - 'aclsyms' - generates a linker script to export the APIs to drivers. Some examples virConnectBaselineCPUEnsureACL; virConnectCompareCPUEnsureACL; Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-04-18 16:49:41 +00:00
# Add all conditional sources just in case...
EXTRA_DIST += \
$(SECURITY_DRIVER_SELINUX_SOURCES) \
$(SECURITY_DRIVER_APPARMOR_SOURCES) \
$(ACCESS_DRIVER_POLKIT_POLICY)
check-local: check-augeas
.PHONY: check-augeas \
check-augeas-sanlock \
check-augeas-lockd \
$(NULL)
check-augeas: $(AUGEAS_DIRS:%=check-augeas-%) \
check-augeas-sanlock \
check-augeas-lockd check-augeas-virtlockd \
check-augeas-virtlogd
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
if WITH_SANLOCK
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
locking/qemu-sanlock.conf $(AUG_GENTEST)
build: fix 'make distcheck' issues We had a distributed file (remote_protocol.h, which in turn was a prereq to remote_driver.c) depending on a generated file (libvirt_probes.h), which is a no-no for a VPATH build from a read-only source tree (no wonder 'make distcheck' tests precisely that situation): File `libvirt_driver_remote.la' does not exist. File `libvirt_driver_remote_la-remote_driver.lo' does not exist. Prerequisite `libvirt_probes.h' is newer than target `../../src/remote/remote_protocol.h'. Must remake target `../../src/remote/remote_protocol.h'. Invoking recipe from Makefile:7464 to update target `../../src/remote/remote_protocol.h'. make[3]: Entering directory `/home/remote/eblake/libvirt-tmp2/build/libvirt-0.9.12/_build/src' GEN ../../src/remote/remote_protocol.h cannot create ../../src/remote/remote_protocol.h: Permission denied at ../../src/rpc/genprotocol.pl line 31. make[3]: *** [../../src/remote/remote_protocol.h] Error 13 Rather than making distributed .c files depend on generated files, we really want to ensure that compilation into .lo files is not attempted until the generated files are present, done by this patch. Since there were two different sets of conditionally generated files that both feed the .lo file, I had to introduce a new variable REMOTE_DRIVER_PREREQS to keep automake happy. After that fix, the next issue was that make treats './foo' and 'foo' differently in determining whether an implicit %foo rule is applicable, with the result that locking/qemu-sanlock.conf wasn't properly being built at the right times. Also, the output for using the .aug test files was a bit verbose. After fixing the src directory, the next error is related to the docs directory, where the tarball is missing a stamp file and thus tries to regenerate files that are already present: GEN ../../docs/apibuild.py.stamp Traceback (most recent call last): File "../../docs/apibuild.py", line 2511, in <module> rebuild("libvirt") File "../../docs/apibuild.py", line 2495, in rebuild builder.serialize() File "../../docs/apibuild.py", line 2424, in serialize output = open(filename, "w") IOError: [Errno 13] Permission denied: '../../docs/libvirt-api.xml' make[5]: *** [../../docs/apibuild.py.stamp] Error 1 and fixing that exposed another case of a distributed file (generated html) depending on a built file (libvirt.h), but only when doing an in-tree build, because of a file glob. * src/Makefile.am ($(srcdir)/remote/remote_driver.c): Change... (libvirt_driver_remote_la-remote_driver.lo): ...to the real dependency. ($(builddir)/locking/%-sanlock.conf): Drop $(builddir), so that rule gets run in time for test_libvirt_sanlock.aug. (test_libvir*.aug): Cater to silent build. (conf_DATA): Don't ship qemu-sanlock.conf in the tarball, since it is trivial to regenerate. * docs/Makefile.am (EXTRA_DIST): Ship our stamp file. ($(APIBUILD_STAMP)): Don't depend on generated file.
2012-05-30 17:30:18 +00:00
$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
check-augeas-sanlock: test_libvirt_sanlock.aug
$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
'$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
fi
else ! WITH_SANLOCK
check-augeas-sanlock:
endif ! WITH_SANLOCK
if WITH_QEMU
test_libvirt_lockd.aug: locking/test_libvirt_lockd.aug.in \
locking/qemu-lockd.conf $(AUG_GENTEST)
$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-lockd.conf $< $@
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
test_virtlockd.aug: locking/test_virtlockd.aug.in \
locking/virtlockd.conf $(AUG_GENTEST)
$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
if WITH_QEMU
check-augeas-lockd: test_libvirt_lockd.aug
$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
'$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
fi
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
check-augeas-virtlockd: test_virtlockd.aug
$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
'$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
fi
test_virtlogd.aug: logging/test_virtlogd.aug.in \
logging/virtlogd.conf $(AUG_GENTEST)
$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/logging/virtlogd.conf $< $@
check-augeas-virtlogd: test_virtlogd.aug
$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
'$(AUGPARSE)' -I $(srcdir)/logging test_virtlogd.aug; \
fi
#
# Build our version script. This is composed of three parts:
#
# 1. libvirt_public.syms - public API. These functions are always
# present in the library and should never change incompatibly.
#
# 2. libvirt_private.syms - private API. These symbols are private and
# semantics may change on every release, hence the version number is
# spliced in at build time. This ensures that if libvirtd, virsh, or a
# driver module was built against one libvirt release, it will refuse to
# load with another where symbols may have same names but different
# semantics. Such symbols should never be visible in an (installed)
# public header file.
#
# 3. libvirt_*.syms - dynamic private API. Like libvirt_private.syms,
# except that build options (such as --enable-debug) can mean these
# symbols aren't present at all.
#
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
if WITH_LINUX
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
else ! WITH_LINUX
SYM_FILES += $(srcdir)/libvirt_linux.syms
endif ! WITH_LINUX
if WITH_VMX
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
else ! WITH_VMX
SYM_FILES += $(srcdir)/libvirt_vmx.syms
endif ! WITH_VMX
if WITH_SASL
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
else ! WITH_SASL
SYM_FILES += $(srcdir)/libvirt_sasl.syms
endif ! WITH_SASL
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
else ! WITH_GNUTLS
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
endif ! WITH_GNUTLS
2013-01-08 21:34:15 +00:00
if WITH_SSH2
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
else ! WITH_SSH2
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
endif ! WITH_SSH2
if WITH_ATOMIC_OPS_PTHREAD
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
else ! WITH_ATOMIC_OPS_PTHREAD
SYM_FILES += $(srcdir)/libvirt_atomic.syms
endif ! WITH_ATOMIC_OPS_PTHREAD
if WITH_LIBSSH
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
else ! WITH_LIBSSH
SYM_FILES += $(srcdir)/libvirt_libssh.syms
endif ! WITH_LIBSSH
EXTRA_DIST += \
libvirt_public.syms \
libvirt_lxc.syms \
libvirt_qemu.syms \
libvirt_admin_public.syms \
$(SYM_FILES) \
$(ADMIN_SYM_FILES) \
$(NULL)
BUILT_SOURCES += $(GENERATED_SYM_FILES)
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
$(ACCESS_DRIVER_SYM_FILES) \
$(top_builddir)/config.status
$(AM_V_GEN)rm -f $@-tmp $@ ; \
printf '# WARNING: generated from the following:\n# $^\n\n' >$@-tmp && \
cat $(srcdir)/libvirt_public.syms >>$@-tmp && \
printf '\n\n# Private symbols\n\n' >>$@-tmp && \
printf 'LIBVIRT_PRIVATE_$(VERSION) {\n\n' >>$@-tmp && \
printf 'global:\n\n' >>$@-tmp && \
cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
chmod a-w $@-tmp && \
mv $@-tmp libvirt.syms
%.def: %.syms
$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
printf 'EXPORTS\n' > $@-tmp && \
sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d' \
-e 's/[ ]*\(.*\)\;/ \1/g' $^ >> $@-tmp && \
chmod a-w $@-tmp && \
mv $@-tmp $@
libvirt_admin.syms: libvirt_admin_public.syms $(ADMIN_SYM_FILES) \
$(top_builddir)/config.status
$(AM_V_GEN)rm -f $@-tmp $@ ; \
printf '# WARNING: generated from the following:\n# $^\n\n' >$@-tmp && \
cat $(srcdir)/libvirt_admin_public.syms >>$@-tmp && \
printf '\n\n# Private symbols\n\n' >>$@-tmp && \
printf 'LIBVIRT_ADMIN_PRIVATE_$(VERSION) {\n\n' >>$@-tmp && \
printf 'global:\n\n' >>$@-tmp && \
cat $(ADMIN_SYM_FILES) >>$@-tmp && \
printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
chmod a-w $@-tmp && \
mv $@-tmp libvirt_admin.syms
admin/admin_server_dispatch.c: admin/admin_server_dispatch_stubs.h
noinst_LTLIBRARIES += libvirt_driver_admin.la
libvirt_driver_admin_la_SOURCES = \
admin/admin_protocol.c \
admin/admin_protocol.h \
admin/admin_server.c \
admin/admin_server.h \
admin/admin_server_dispatch.c \
admin/admin_server_dispatch.h \
admin/admin_server_dispatch_stubs.h \
$(NULL)
libvirt_driver_admin_la_CFLAGS = \
$(AM_CFLAGS) \
$(XDR_CFLAGS) \
-I$(top_srcdir)/src/util \
-I$(top_srcdir)/src/admin \
$(NULL)
libvirt_driver_admin_la_LIBADD = ../gnulib/lib/libgnu.la
libvirt_driver_admin_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
# admin/admin_remote.c is being included in libvirt-admin.c, so we
# need to include it in the dist
EXTRA_DIST += admin/admin_remote.c
lib_LTLIBRARIES += libvirt-admin.la
libvirt_admin_la_SOURCES = \
libvirt-admin.c \
$(ADMIN_PROTOCOL_GENERATED) \
$(DATATYPES_SOURCES)
libvirt_admin_la_LDFLAGS = \
$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE) \
-version-info $(LIBVIRT_VERSION_INFO) \
$(AM_LDFLAGS)
libvirt_admin_la_LIBADD = \
libvirt.la \
$(CYGWIN_EXTRA_LIBADD)
libvirt_admin_la_CFLAGS = \
$(AM_CFLAGS) \
-I$(srcdir)/remote \
-I$(srcdir)/rpc \
-I$(srcdir)/admin
libvirt_admin_la_CFLAGS += \
$(XDR_CFLAGS) \
$(CAPNG_CFLAGS) \
$(YAJL_CFLAGS) \
$(SSH2_CFLAGS) \
$(SASL_CFLAGS) \
$(GNUTLS_CFLAGS) \
$(LIBSSH_CFLAGS)
libvirt_admin_la_LIBADD += \
$(CAPNG_LIBS) \
$(YAJL_LIBS) \
$(DEVMAPPER_LIBS) \
$(LIBXML_LIBS) \
$(SSH2_LIBS) \
$(SASL_LIBS) \
$(GNUTLS_LIBS) \
$(LIBSSH_LIBS)
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
libvirt_la_LDFLAGS = \
$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
-version-info $(LIBVIRT_VERSION_INFO) \
$(LIBVIRT_NODELETE) \
$(NO_UNDEFINED_LDFLAGS) \
$(AM_LDFLAGS) \
$(NULL)
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
libvirt_la_LIBADD += \
$(DRIVER_MODULES_LIBS) \
$(CYGWIN_EXTRA_LIBADD)
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
# Because we specify libvirt_la_DEPENDENCIES for $(LIBVIRT_SYMBOL_FILE), we
# lose automake's automatic dependencies on an appropriate subset of
# $(libvirt_la_LIBADD). But we were careful to create
# $(libvirt_la_BUILT_LIBADD) as the subset that automake would have
# picked out for us.
libvirt_la_DEPENDENCIES = $(libvirt_la_BUILT_LIBADD) $(LIBVIRT_SYMBOL_FILE)
2007-06-15 01:21:18 +00:00
if WITH_DTRACE_PROBES
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
nodist_libvirt_la_SOURCES = libvirt_probes.h
if WITH_REMOTE
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
endif WITH_REMOTE
DTRACE2SYSTEMTAP_FLAGS = --with-modules
Rewrite all the DTrace/SystemTAP probing The libvirtd daemon had a few crude system tap probes. Some of these were broken during the RPC rewrite. The new modular RPC code is structured in a way that allows much more effective tracing. Instead of trying to hook up the original probes, define a new set of probes for the RPC and event code. The master probes file is now src/probes.d. This contains probes for virNetServerClientPtr, virNetClientPtr, virSocketPtr virNetTLSContextPtr and virNetTLSSessionPtr modules. Also add probes for the poll event loop. The src/dtrace2systemtap.pl script can convert the probes.d file into a libvirt_probes.stp file to make use from systemtap much simpler. The src/rpc/gensystemtap.pl script can generate a set of systemtap functions for translating RPC enum values into printable strings. This works for all RPC header enums (program, type, status, procedure) and also the authentication enum The PROBE macro will automatically generate a VIR_DEBUG statement, so any place with a PROBE can remove any existing manual DEBUG statements. * daemon/libvirtd.stp, daemon/probes.d: Remove obsolete probing * daemon/libvirtd.h: Remove probe macros * daemon/Makefile.am: Remove all probe buildings/install * daemon/remote.c: Update authentication probes * src/dtrace2systemtap.pl, src/rpc/gensystemtap.pl: Scripts to generate STP files * src/internal.h: Add probe macros * src/probes.d: Master list of probes * src/rpc/virnetclient.c, src/rpc/virnetserverclient.c, src/rpc/virnetsocket.c, src/rpc/virnettlscontext.c, src/util/event_poll.c: Insert probe points, removing any DEBUG statements that duplicate the info
2011-09-30 13:40:23 +00:00
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp
Rewrite all the DTrace/SystemTAP probing The libvirtd daemon had a few crude system tap probes. Some of these were broken during the RPC rewrite. The new modular RPC code is structured in a way that allows much more effective tracing. Instead of trying to hook up the original probes, define a new set of probes for the RPC and event code. The master probes file is now src/probes.d. This contains probes for virNetServerClientPtr, virNetClientPtr, virSocketPtr virNetTLSContextPtr and virNetTLSSessionPtr modules. Also add probes for the poll event loop. The src/dtrace2systemtap.pl script can convert the probes.d file into a libvirt_probes.stp file to make use from systemtap much simpler. The src/rpc/gensystemtap.pl script can generate a set of systemtap functions for translating RPC enum values into printable strings. This works for all RPC header enums (program, type, status, procedure) and also the authentication enum The PROBE macro will automatically generate a VIR_DEBUG statement, so any place with a PROBE can remove any existing manual DEBUG statements. * daemon/libvirtd.stp, daemon/probes.d: Remove obsolete probing * daemon/libvirtd.h: Remove probe macros * daemon/Makefile.am: Remove all probe buildings/install * daemon/remote.c: Update authentication probes * src/dtrace2systemtap.pl, src/rpc/gensystemtap.pl: Scripts to generate STP files * src/internal.h: Add probe macros * src/probes.d: Master list of probes * src/rpc/virnetclient.c, src/rpc/virnetserverclient.c, src/rpc/virnetsocket.c, src/rpc/virnettlscontext.c, src/util/event_poll.c: Insert probe points, removing any DEBUG statements that duplicate the info
2011-09-30 13:40:23 +00:00
tapsetdir = $(datadir)/systemtap/tapset
tapset_DATA += libvirt_probes.stp libvirt_functions.stp
Rewrite all the DTrace/SystemTAP probing The libvirtd daemon had a few crude system tap probes. Some of these were broken during the RPC rewrite. The new modular RPC code is structured in a way that allows much more effective tracing. Instead of trying to hook up the original probes, define a new set of probes for the RPC and event code. The master probes file is now src/probes.d. This contains probes for virNetServerClientPtr, virNetClientPtr, virSocketPtr virNetTLSContextPtr and virNetTLSSessionPtr modules. Also add probes for the poll event loop. The src/dtrace2systemtap.pl script can convert the probes.d file into a libvirt_probes.stp file to make use from systemtap much simpler. The src/rpc/gensystemtap.pl script can generate a set of systemtap functions for translating RPC enum values into printable strings. This works for all RPC header enums (program, type, status, procedure) and also the authentication enum The PROBE macro will automatically generate a VIR_DEBUG statement, so any place with a PROBE can remove any existing manual DEBUG statements. * daemon/libvirtd.stp, daemon/probes.d: Remove obsolete probing * daemon/libvirtd.h: Remove probe macros * daemon/Makefile.am: Remove all probe buildings/install * daemon/remote.c: Update authentication probes * src/dtrace2systemtap.pl, src/rpc/gensystemtap.pl: Scripts to generate STP files * src/internal.h: Add probe macros * src/probes.d: Master list of probes * src/rpc/virnetclient.c, src/rpc/virnetserverclient.c, src/rpc/virnetsocket.c, src/rpc/virnettlscontext.c, src/util/event_poll.c: Insert probe points, removing any DEBUG statements that duplicate the info
2011-09-30 13:40:23 +00:00
%_probes.h: %_probes.d
Rewrite all the DTrace/SystemTAP probing The libvirtd daemon had a few crude system tap probes. Some of these were broken during the RPC rewrite. The new modular RPC code is structured in a way that allows much more effective tracing. Instead of trying to hook up the original probes, define a new set of probes for the RPC and event code. The master probes file is now src/probes.d. This contains probes for virNetServerClientPtr, virNetClientPtr, virSocketPtr virNetTLSContextPtr and virNetTLSSessionPtr modules. Also add probes for the poll event loop. The src/dtrace2systemtap.pl script can convert the probes.d file into a libvirt_probes.stp file to make use from systemtap much simpler. The src/rpc/gensystemtap.pl script can generate a set of systemtap functions for translating RPC enum values into printable strings. This works for all RPC header enums (program, type, status, procedure) and also the authentication enum The PROBE macro will automatically generate a VIR_DEBUG statement, so any place with a PROBE can remove any existing manual DEBUG statements. * daemon/libvirtd.stp, daemon/probes.d: Remove obsolete probing * daemon/libvirtd.h: Remove probe macros * daemon/Makefile.am: Remove all probe buildings/install * daemon/remote.c: Update authentication probes * src/dtrace2systemtap.pl, src/rpc/gensystemtap.pl: Scripts to generate STP files * src/internal.h: Add probe macros * src/probes.d: Master list of probes * src/rpc/virnetclient.c, src/rpc/virnetserverclient.c, src/rpc/virnetsocket.c, src/rpc/virnettlscontext.c, src/util/event_poll.c: Insert probe points, removing any DEBUG statements that duplicate the info
2011-09-30 13:40:23 +00:00
$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<
.PRECIOUS: %_probes.o
%_probes.o: %_probes.d
Rewrite all the DTrace/SystemTAP probing The libvirtd daemon had a few crude system tap probes. Some of these were broken during the RPC rewrite. The new modular RPC code is structured in a way that allows much more effective tracing. Instead of trying to hook up the original probes, define a new set of probes for the RPC and event code. The master probes file is now src/probes.d. This contains probes for virNetServerClientPtr, virNetClientPtr, virSocketPtr virNetTLSContextPtr and virNetTLSSessionPtr modules. Also add probes for the poll event loop. The src/dtrace2systemtap.pl script can convert the probes.d file into a libvirt_probes.stp file to make use from systemtap much simpler. The src/rpc/gensystemtap.pl script can generate a set of systemtap functions for translating RPC enum values into printable strings. This works for all RPC header enums (program, type, status, procedure) and also the authentication enum The PROBE macro will automatically generate a VIR_DEBUG statement, so any place with a PROBE can remove any existing manual DEBUG statements. * daemon/libvirtd.stp, daemon/probes.d: Remove obsolete probing * daemon/libvirtd.h: Remove probe macros * daemon/Makefile.am: Remove all probe buildings/install * daemon/remote.c: Update authentication probes * src/dtrace2systemtap.pl, src/rpc/gensystemtap.pl: Scripts to generate STP files * src/internal.h: Add probe macros * src/probes.d: Master list of probes * src/rpc/virnetclient.c, src/rpc/virnetserverclient.c, src/rpc/virnetsocket.c, src/rpc/virnettlscontext.c, src/util/event_poll.c: Insert probe points, removing any DEBUG statements that duplicate the info
2011-09-30 13:40:23 +00:00
$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<
%_probes.lo: %_probes.o
$(AM_V_GEN)printf %s\\n \
'# $@ - a libtool object file' \
'# Generated by libtool (GNU libtool) 2.4' \
'# Actually generated by Makefile.am, in order to shut up libtool' \
"pic_object='$<'" \
"non_pic_object='$<'" \
> $@
# Keep this list synced with PROTOCOL_STRUCTS
RPC_PROBE_FILES += $(srcdir)/rpc/virnetprotocol.x \
$(srcdir)/rpc/virkeepaliveprotocol.x \
$(srcdir)/remote/remote_protocol.x \
$(srcdir)/remote/lxc_protocol.x \
$(srcdir)/remote/qemu_protocol.x \
$(srcdir)/locking/lock_protocol.x \
$(srcdir)/admin/admin_protocol.x
Rewrite all the DTrace/SystemTAP probing The libvirtd daemon had a few crude system tap probes. Some of these were broken during the RPC rewrite. The new modular RPC code is structured in a way that allows much more effective tracing. Instead of trying to hook up the original probes, define a new set of probes for the RPC and event code. The master probes file is now src/probes.d. This contains probes for virNetServerClientPtr, virNetClientPtr, virSocketPtr virNetTLSContextPtr and virNetTLSSessionPtr modules. Also add probes for the poll event loop. The src/dtrace2systemtap.pl script can convert the probes.d file into a libvirt_probes.stp file to make use from systemtap much simpler. The src/rpc/gensystemtap.pl script can generate a set of systemtap functions for translating RPC enum values into printable strings. This works for all RPC header enums (program, type, status, procedure) and also the authentication enum The PROBE macro will automatically generate a VIR_DEBUG statement, so any place with a PROBE can remove any existing manual DEBUG statements. * daemon/libvirtd.stp, daemon/probes.d: Remove obsolete probing * daemon/libvirtd.h: Remove probe macros * daemon/Makefile.am: Remove all probe buildings/install * daemon/remote.c: Update authentication probes * src/dtrace2systemtap.pl, src/rpc/gensystemtap.pl: Scripts to generate STP files * src/internal.h: Add probe macros * src/probes.d: Master list of probes * src/rpc/virnetclient.c, src/rpc/virnetserverclient.c, src/rpc/virnetsocket.c, src/rpc/virnettlscontext.c, src/util/event_poll.c: Insert probe points, removing any DEBUG statements that duplicate the info
2011-09-30 13:40:23 +00:00
libvirt_functions.stp: $(RPC_PROBE_FILES) $(srcdir)/rpc/gensystemtap.pl
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gensystemtap.pl $(RPC_PROBE_FILES) > $@
Rewrite all the DTrace/SystemTAP probing The libvirtd daemon had a few crude system tap probes. Some of these were broken during the RPC rewrite. The new modular RPC code is structured in a way that allows much more effective tracing. Instead of trying to hook up the original probes, define a new set of probes for the RPC and event code. The master probes file is now src/probes.d. This contains probes for virNetServerClientPtr, virNetClientPtr, virSocketPtr virNetTLSContextPtr and virNetTLSSessionPtr modules. Also add probes for the poll event loop. The src/dtrace2systemtap.pl script can convert the probes.d file into a libvirt_probes.stp file to make use from systemtap much simpler. The src/rpc/gensystemtap.pl script can generate a set of systemtap functions for translating RPC enum values into printable strings. This works for all RPC header enums (program, type, status, procedure) and also the authentication enum The PROBE macro will automatically generate a VIR_DEBUG statement, so any place with a PROBE can remove any existing manual DEBUG statements. * daemon/libvirtd.stp, daemon/probes.d: Remove obsolete probing * daemon/libvirtd.h: Remove probe macros * daemon/Makefile.am: Remove all probe buildings/install * daemon/remote.c: Update authentication probes * src/dtrace2systemtap.pl, src/rpc/gensystemtap.pl: Scripts to generate STP files * src/internal.h: Add probe macros * src/probes.d: Master list of probes * src/rpc/virnetclient.c, src/rpc/virnetserverclient.c, src/rpc/virnetsocket.c, src/rpc/virnettlscontext.c, src/util/event_poll.c: Insert probe points, removing any DEBUG statements that duplicate the info
2011-09-30 13:40:23 +00:00
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
$(top_builddir)/config.status
$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
$(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
Rewrite all the DTrace/SystemTAP probing The libvirtd daemon had a few crude system tap probes. Some of these were broken during the RPC rewrite. The new modular RPC code is structured in a way that allows much more effective tracing. Instead of trying to hook up the original probes, define a new set of probes for the RPC and event code. The master probes file is now src/probes.d. This contains probes for virNetServerClientPtr, virNetClientPtr, virSocketPtr virNetTLSContextPtr and virNetTLSSessionPtr modules. Also add probes for the poll event loop. The src/dtrace2systemtap.pl script can convert the probes.d file into a libvirt_probes.stp file to make use from systemtap much simpler. The src/rpc/gensystemtap.pl script can generate a set of systemtap functions for translating RPC enum values into printable strings. This works for all RPC header enums (program, type, status, procedure) and also the authentication enum The PROBE macro will automatically generate a VIR_DEBUG statement, so any place with a PROBE can remove any existing manual DEBUG statements. * daemon/libvirtd.stp, daemon/probes.d: Remove obsolete probing * daemon/libvirtd.h: Remove probe macros * daemon/Makefile.am: Remove all probe buildings/install * daemon/remote.c: Update authentication probes * src/dtrace2systemtap.pl, src/rpc/gensystemtap.pl: Scripts to generate STP files * src/internal.h: Add probe macros * src/probes.d: Master list of probes * src/rpc/virnetclient.c, src/rpc/virnetserverclient.c, src/rpc/virnetsocket.c, src/rpc/virnettlscontext.c, src/util/event_poll.c: Insert probe points, removing any DEBUG statements that duplicate the info
2011-09-30 13:40:23 +00:00
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
libvirt_functions.stp libvirt_probes.stp
endif WITH_DTRACE_PROBES
Rewrite all the DTrace/SystemTAP probing The libvirtd daemon had a few crude system tap probes. Some of these were broken during the RPC rewrite. The new modular RPC code is structured in a way that allows much more effective tracing. Instead of trying to hook up the original probes, define a new set of probes for the RPC and event code. The master probes file is now src/probes.d. This contains probes for virNetServerClientPtr, virNetClientPtr, virSocketPtr virNetTLSContextPtr and virNetTLSSessionPtr modules. Also add probes for the poll event loop. The src/dtrace2systemtap.pl script can convert the probes.d file into a libvirt_probes.stp file to make use from systemtap much simpler. The src/rpc/gensystemtap.pl script can generate a set of systemtap functions for translating RPC enum values into printable strings. This works for all RPC header enums (program, type, status, procedure) and also the authentication enum The PROBE macro will automatically generate a VIR_DEBUG statement, so any place with a PROBE can remove any existing manual DEBUG statements. * daemon/libvirtd.stp, daemon/probes.d: Remove obsolete probing * daemon/libvirtd.h: Remove probe macros * daemon/Makefile.am: Remove all probe buildings/install * daemon/remote.c: Update authentication probes * src/dtrace2systemtap.pl, src/rpc/gensystemtap.pl: Scripts to generate STP files * src/internal.h: Add probe macros * src/probes.d: Master list of probes * src/rpc/virnetclient.c, src/rpc/virnetserverclient.c, src/rpc/virnetsocket.c, src/rpc/virnettlscontext.c, src/util/event_poll.c: Insert probe points, removing any DEBUG statements that duplicate the info
2011-09-30 13:40:23 +00:00
EXTRA_DIST += libvirt_probes.d
Rewrite all the DTrace/SystemTAP probing The libvirtd daemon had a few crude system tap probes. Some of these were broken during the RPC rewrite. The new modular RPC code is structured in a way that allows much more effective tracing. Instead of trying to hook up the original probes, define a new set of probes for the RPC and event code. The master probes file is now src/probes.d. This contains probes for virNetServerClientPtr, virNetClientPtr, virSocketPtr virNetTLSContextPtr and virNetTLSSessionPtr modules. Also add probes for the poll event loop. The src/dtrace2systemtap.pl script can convert the probes.d file into a libvirt_probes.stp file to make use from systemtap much simpler. The src/rpc/gensystemtap.pl script can generate a set of systemtap functions for translating RPC enum values into printable strings. This works for all RPC header enums (program, type, status, procedure) and also the authentication enum The PROBE macro will automatically generate a VIR_DEBUG statement, so any place with a PROBE can remove any existing manual DEBUG statements. * daemon/libvirtd.stp, daemon/probes.d: Remove obsolete probing * daemon/libvirtd.h: Remove probe macros * daemon/Makefile.am: Remove all probe buildings/install * daemon/remote.c: Update authentication probes * src/dtrace2systemtap.pl, src/rpc/gensystemtap.pl: Scripts to generate STP files * src/internal.h: Add probe macros * src/probes.d: Master list of probes * src/rpc/virnetclient.c, src/rpc/virnetserverclient.c, src/rpc/virnetsocket.c, src/rpc/virnettlscontext.c, src/util/event_poll.c: Insert probe points, removing any DEBUG statements that duplicate the info
2011-09-30 13:40:23 +00:00
libvirt_qemu_la_SOURCES = libvirt-qemu.c
libvirt_qemu_la_LDFLAGS = \
$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
-version-info $(LIBVIRT_VERSION_INFO) \
$(AM_LDFLAGS) \
$(NULL)
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
libvirt_lxc_la_SOURCES = libvirt-lxc.c
libvirt_lxc_la_LDFLAGS = \
$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
-version-info $(LIBVIRT_VERSION_INFO) \
$(AM_LDFLAGS) \
$(NULL)
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
# Since virt-login-shell will be setuid, we must do everything
# we can to avoid linking to other libraries. Many of them do
# unsafe things in functions marked __atttribute__((constructor)).
# This library is built to include the bare minimum required to
# have a RPC client for local UNIX socket access only. We use
# the ../config-post.h header to disable all external deps that
# we don't want
if WITH_SETUID_RPC_CLIENT
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la
libvirt_setuid_rpc_client_la_SOURCES = \
util/viralloc.c \
util/virarch.c \
util/viratomic.c \
util/viratomic.h \
util/virbitmap.c \
util/virbuffer.c \
util/vircgroup.c \
util/vircommand.c \
util/virconf.c \
util/virdbus.c \
util/virerror.c \
util/virevent.c \
util/vireventpoll.c \
util/virfile.c \
util/virgettext.c \
util/virhash.c \
util/virhashcode.c \
util/virhostcpu.c \
util/virjson.c \
util/virlog.c \
util/virobject.c \
util/virpidfile.c \
util/virprocess.c \
util/virrandom.c \
util/virsocketaddr.c \
util/virstring.c \
util/virsystemd.c \
util/virtime.c \
util/virthread.c \
util/virthreadjob.c \
util/virtypedparam.c \
util/viruri.c \
util/virutil.c \
util/viruuid.c \
conf/domain_event.c \
conf/network_event.c \
conf/object_event.c \
conf/storage_event.c \
conf/node_device_event.c \
conf/secret_event.c \
rpc/virnetsocket.c \
rpc/virnetsocket.h \
rpc/virnetmessage.h \
rpc/virnetmessage.c \
rpc/virkeepalive.c \
rpc/virkeepalive.h \
rpc/virnetclient.c \
rpc/virnetclientprogram.c \
rpc/virnetclientstream.c \
rpc/virnetprotocol.c \
remote/remote_driver.c \
remote/remote_protocol.c \
remote/qemu_protocol.c \
remote/lxc_protocol.c \
datatypes.c \
libvirt.c \
libvirt-domain.c \
libvirt-domain-snapshot.c \
libvirt-host.c \
libvirt-interface.c \
libvirt-network.c \
libvirt-nodedev.c \
libvirt-nwfilter.c \
libvirt-secret.c \
libvirt-storage.c \
libvirt-stream.c \
libvirt-lxc.c \
$(NULL)
libvirt_setuid_rpc_client_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(LIBXML_LIBS) \
$(SECDRIVER_LIBS) \
$(NULL)
libvirt_setuid_rpc_client_la_CFLAGS = \
-DLIBVIRT_SETUID_RPC_CLIENT \
-I$(srcdir)/conf \
-I$(srcdir)/rpc \
$(AM_CFLAGS) \
$(SECDRIVER_CFLAGS) \
$(XDR_CFLAGS) \
$(NULL)
endif WITH_SETUID_RPC_CLIENT
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =
if WITH_LIBVIRTD
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
$(LOCK_DRIVER_LOCKD_SOURCES) \
$(LOCK_PROTOCOL_GENERATED) \
$(NULL)
lockd_la_CFLAGS = -I$(srcdir)/conf \
$(XDR_CFLAGS) \
$(AM_CFLAGS)
lockd_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
lockd_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
2012-12-13 22:13:21 +00:00
augeas_DATA += locking/libvirt_lockd.aug
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES
if WITH_QEMU
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
nodist_conf_DATA += locking/qemu-lockd.conf
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
endif WITH_QEMU
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
$(AM_V_GEN)$(MKDIR_P) locking ; \
cp $< $@
sbin_PROGRAMS += virtlockd virtlogd
virtlockd_SOURCES = \
$(LOCK_DAEMON_SOURCES) \
$(LOCK_PROTOCOL_GENERATED) \
$(LOCK_DAEMON_GENERATED) \
$(NULL)
virtlockd_CFLAGS = \
$(AM_CFLAGS) \
$(PIE_CFLAGS) \
$(XDR_CFLAGS) \
$(NULL)
virtlockd_LDFLAGS = \
$(AM_LDFLAGS) \
$(PIE_LDFLAGS) \
$(NO_UNDEFINED_LDFLAGS) \
$(NULL)
virtlockd_LDADD = \
libvirt_driver_admin.la \
libvirt-net-rpc-server.la \
libvirt-net-rpc.la \
libvirt_util.la \
../gnulib/lib/libgnu.la \
$(CYGWIN_EXTRA_LIBADD) \
$(NULL)
if WITH_DTRACE_PROBES
virtlockd_LDADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES
virtlogd_SOURCES = \
$(LOG_DAEMON_SOURCES) \
$(LOG_PROTOCOL_GENERATED) \
$(LOG_DAEMON_GENERATED) \
$(NULL)
virtlogd_CFLAGS = \
$(AM_CFLAGS) \
$(PIE_CFLAGS) \
$(XDR_CFLAGS) \
$(NULL)
virtlogd_LDFLAGS = \
$(AM_LDFLAGS) \
$(PIE_LDFLAGS) \
$(NO_UNDEFINED_LDFLAGS) \
$(NULL)
virtlogd_LDADD = \
libvirt_driver_admin.la \
libvirt-net-rpc-server.la \
libvirt-net-rpc.la \
libvirt_util.la \
../gnulib/lib/libgnu.la \
$(CYGWIN_EXTRA_LIBADD) \
$(NULL)
if WITH_DTRACE_PROBES
virtlogd_LDADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES
else ! WITH_LIBVIRTD
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
$(LOCK_DRIVER_LOCKD_SOURCES) \
$(LOG_DAEMON_SOURCES)
endif ! WITH_LIBVIRTD
SYSCONF_FILES += \
locking/virtlockd.sysconf \
logging/virtlogd.sysconf \
$(NULL)
EXTRA_DIST += \
2012-12-13 22:13:21 +00:00
locking/lockd.conf \
locking/libvirt_lockd.aug \
locking/test_libvirt_lockd.aug.in \
$(SYSCONF_FILES) \
$(NULL)
install-sysconfig:
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
for f in $(SYSCONF_FILES:%.sysconf=%) ; \
do \
tgt=`basename $$f`; \
$(INSTALL_SCRIPT) $(srcdir)/$$f.sysconf \
$(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
done
uninstall-sysconfig:
for f in $(SYSCONF_FILES:%.sysconf=%) ; \
do \
tgt=`basename $$f`; \
rm -f $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
done
rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
SYSVINIT_FILES_IN += \
locking/virtlockd.init.in \
logging/virtlogd.init.in \
$(NULL)
SYSVINIT_FILES = $(notdir $(SYSVINIT_FILES_IN:%.in=%))
EXTRA_DIST += $(SYSVINIT_FILES_IN)
LOGROTATE_FILES := $(LOGROTATE_FILES_IN:remote/%.in=%)
EXTRA_DIST += $(LOGROTATE_FILES_IN)
BUILT_SOURCES += $(LOGROTATE_FILES)
CLEANFILES += $(LOGROTATE_FILES)
%.logrotate: remote/%.logrotate.in
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
< $< > $@-t && \
mv $@-t $@
if WITH_LIBVIRTD
install-logrotate: $(LOGROTATE_FILES)
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/logrotate.d/
for f in $(LOGROTATE_FILES) ; \
do \
tgt=`echo $$f | sed -e 's/.logrotate//'`; \
$(INSTALL_DATA) $$f \
$(DESTDIR)$(sysconfdir)/logrotate.d/$$tgt; \
done
uninstall-logrotate:
rm -f $(LOGROTATE_FILES:%.logrotate=$(DESTDIR)$(sysconfdir)/logrotate.d/%)
rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || :
else ! WITH_LIBVIRTD
install-logrotate:
uninstall-logrotate:
endif ! WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_RED_HAT
install-init:: $(SYSVINIT_FILES) install-sysconfig
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
for f in $(SYSVINIT_FILES:%.init=%) ; \
do \
$(INSTALL_SCRIPT) $$f.init $(DESTDIR)$(sysconfdir)/rc.d/init.d/$$f; \
done
uninstall-init:: uninstall-sysconfig
rm -f $(SYSVINIT_FILES:%.init=$(DESTDIR)$(sysconfdir)/rc.d/init.d/%)
rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
BUILT_SOURCES += $(SYSVINIT_FILES)
DISTCLEANFILES += $(SYSVINIT_FILES)
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
install-init::
uninstall-init::
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's|[@]sbindir[@]|$(sbindir)|g' \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
< $< > $@-t && \
chmod a+x $@-t && \
mv $@-t $@
virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
-e 's|[@]sbindir[@]|$(sbindir)|g' \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
< $< > $@-t && \
chmod a+x $@-t && \
mv $@-t $@
virtlockd.8.in: locking/virtlockd.pod
$(AM_V_GEN)$(POD2MAN) --section=8 $< $@-t1 && \
if grep 'POD ERROR' $@-t1; then rm $@-t1; exit 1; fi && \
sed \
-e 's|SYSCONFDIR|\@sysconfdir\@|g' \
-e 's|LOCALSTATEDIR|\@localstatedir\@|g' \
< $@-t1 > $@-t2 && \
rm -f $@-t1 && \
mv $@-t2 $@
virtlogd.8.in: logging/virtlogd.pod
$(AM_V_GEN)$(POD2MAN) --section=8 $< $@-t1 && \
if grep 'POD ERROR' $@-t1; then rm $@-t1; exit 1; fi && \
sed \
-e 's|SYSCONFDIR|\@sysconfdir\@|g' \
-e 's|LOCALSTATEDIR|\@localstatedir\@|g' \
< $@-t1 > $@-t2 && \
rm -f $@-t1 && \
mv $@-t2 $@
%.8: %.8.in $(top_srcdir)/configure.ac
$(AM_V_GEN)sed \
-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
< $< > $@-t && \
mv $@-t $@
if WITH_LIBVIRTD
man8_MANS += virtlockd.8 virtlogd.8
conf_DATA += locking/virtlockd.conf logging/virtlogd.conf
augeas_DATA += locking/virtlockd.aug logging/virtlogd.aug
augeastest_DATA += test_virtlockd.aug test_virtlogd.aug
endif WITH_LIBVIRTD
PODFILES += \
locking/virtlockd.pod \
logging/virtlogd.pod \
$(NULL)
MANINFILES += \
virtlockd.8.in \
virtlogd.8.in \
$(NULL)
CLEANFILES += test_virtlockd.aug test_virtlogd.aug $(man8_MANS)
MAINTAINERCLEANFILES += $(MANINFILES)
SYSTEMD_UNIT_FILES_IN += \
locking/virtlockd.service.in \
locking/virtlockd.socket.in \
locking/virtlockd-admin.socket.in \
logging/virtlogd.service.in \
logging/virtlogd.socket.in \
logging/virtlogd-admin.socket.in \
$(NULL)
EXTRA_DIST += \
$(SYSTEMD_UNIT_FILES_IN) \
locking/virtlockd.aug \
locking/virtlockd.conf \
locking/test_virtlockd.aug.in \
logging/virtlogd.aug \
logging/virtlogd.conf \
logging/test_virtlogd.aug.in \
$(PODFILES) \
$(MANINFILES) \
$(NULL)
if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD
build: add $(prefix) to SYSTEMD_UNIT_DIR I noticed this problem when adding systemd support to netcf, because I setup the configure.ac to automatically prefer using systemd over initscripts when possible - although I had copied the install-data-local target from the example of libvirt's "libvirt-guests" service more or less verbatim, "make distcheck" would fail because it was trying to install the service file directly into /lib/systemd/system rather than into /home/user/some/unimportant/name/lib/systemd/system. This is caused by the install/uninstall rules for the systemd unit files relying on $(DESTDIR) pointing the installed files to the right place, but in reality $(DESTDIR) is empty during this part of make distcheck - it instead sets $(prefix) with the toplevel directory used for its test build/install/uninstall cycle. (This problem hasn't been seen when running "make distcheck" in libvirt because libvirt will never build/install systemd support unless explicitly told to do so on the configure commandline, and "make distcheck" doesn't put the "--with-initscript=..." option on the configure commandline.) I verified that the same problem does exist in libvirt by modifying libvirt's configure.ac to set: init_systemd=yes with_init_script=systemd+redhat This forces a build/install of the systemd unit files during distcheck, which yields an error like this: /usr/bin/install -c -m 644 virtlockd.service \ /lib/systemd/system/ libtool: install: warning: relinking `libvirt-qemu.la' /usr/bin/install: cannot remove '/lib/systemd/system/virtlockd.service': Permission denied make[4]: *** [install-systemd] Error 1 After adding $(prefix) to all the definitions of SYSTEMD_UNIT_DIR, make distcheck now completes successfully with the modified configure.ac, and the above lines change to something like this: /usr/bin/install -c -m 644 virtlockd.service \ /home/laine/devel/libvirt/libvirt-1.2.1/_inst/lib/systemd/system/
2014-01-17 12:11:58 +00:00
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
SYSTEMD_UNIT_FILES = $(notdir $(SYSTEMD_UNIT_FILES_IN:%.in=%))
BUILT_SOURCES += $(SYSTEMD_UNIT_FILES)
DISTCLEANFILES += $(SYSTEMD_UNIT_FILES)
install-systemd: $(SYSTEMD_UNIT_FILES) install-sysconfig
$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
for f in $(SYSTEMD_UNIT_FILES); \
do \
$(INSTALL_DATA) $$f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/ ; \
done
uninstall-systemd: uninstall-sysconfig
rm -f $(SYSTEMD_UNIT_FILES:%=$(DESTDIR)$(SYSTEMD_UNIT_DIR)/%)
rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
install-systemd:
uninstall-systemd:
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
install-systemd:
uninstall-systemd:
endif ! WITH_LIBVIRTD
virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's|[@]sbindir[@]|$(sbindir)|g' \
< $< > $@-t && \
mv $@-t $@
virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
< $< > $@-t && \
mv $@-t $@
virtlockd-admin.socket: locking/virtlockd-admin.socket.in \
$(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
< $< > $@-t && \
mv $@-t $@
virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's|[@]sbindir[@]|$(sbindir)|g' \
< $< > $@-t && \
mv $@-t $@
virtlogd.socket: logging/virtlogd.socket.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
< $< > $@-t && \
mv $@-t $@
virtlogd-admin.socket: logging/virtlogd-admin.socket.in \
$(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
< $< > $@-t && \
mv $@-t $@
EXTRA_DIST += $(UPSTART_FILES)
if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_UPSTART
install-upstart: install-sysconfig
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/event.d
for f in $(UPSTART_FILES:%.upstart=%); \
do \
tgt=`basename $$f` ; \
$(INSTALL_SCRIPT) $(srcdir)/$$f.upstart \
$(DESTDIR)$(sysconfdir)/event.d/$$tgt ; \
done
uninstall-upstart: uninstall-sysconfig
for f in $(UPSTART_FILES:%.upstart=%); \
do \
tgt=`basename $$f` ; \
rm -f $(DESTDIR)$(sysconfdir)/event.d/$$tgt ; \
done
rmdir $(DESTDIR)$(sysconfdir)/event.d || :
else ! LIBVIRT_INIT_SCRIPT_UPSTART
install-upstart:
uninstall-upstart:
endif ! LIBVIRT_INIT_SCRIPT_UPSTART
else ! WITH_LIBVIRTD
install-upstart:
uninstall-upstart:
endif ! WITH_LIBVIRTD
if WITH_SANLOCK
lockdriver_LTLIBRARIES += sanlock.la
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
sanlock_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
sanlock_la_LIBADD = -lsanlock_client libvirt.la ../gnulib/lib/libgnu.la
augeas_DATA += locking/libvirt_sanlock.aug
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
build: fix 'make distcheck' issues We had a distributed file (remote_protocol.h, which in turn was a prereq to remote_driver.c) depending on a generated file (libvirt_probes.h), which is a no-no for a VPATH build from a read-only source tree (no wonder 'make distcheck' tests precisely that situation): File `libvirt_driver_remote.la' does not exist. File `libvirt_driver_remote_la-remote_driver.lo' does not exist. Prerequisite `libvirt_probes.h' is newer than target `../../src/remote/remote_protocol.h'. Must remake target `../../src/remote/remote_protocol.h'. Invoking recipe from Makefile:7464 to update target `../../src/remote/remote_protocol.h'. make[3]: Entering directory `/home/remote/eblake/libvirt-tmp2/build/libvirt-0.9.12/_build/src' GEN ../../src/remote/remote_protocol.h cannot create ../../src/remote/remote_protocol.h: Permission denied at ../../src/rpc/genprotocol.pl line 31. make[3]: *** [../../src/remote/remote_protocol.h] Error 13 Rather than making distributed .c files depend on generated files, we really want to ensure that compilation into .lo files is not attempted until the generated files are present, done by this patch. Since there were two different sets of conditionally generated files that both feed the .lo file, I had to introduce a new variable REMOTE_DRIVER_PREREQS to keep automake happy. After that fix, the next issue was that make treats './foo' and 'foo' differently in determining whether an implicit %foo rule is applicable, with the result that locking/qemu-sanlock.conf wasn't properly being built at the right times. Also, the output for using the .aug test files was a bit verbose. After fixing the src directory, the next error is related to the docs directory, where the tarball is missing a stamp file and thus tries to regenerate files that are already present: GEN ../../docs/apibuild.py.stamp Traceback (most recent call last): File "../../docs/apibuild.py", line 2511, in <module> rebuild("libvirt") File "../../docs/apibuild.py", line 2495, in rebuild builder.serialize() File "../../docs/apibuild.py", line 2424, in serialize output = open(filename, "w") IOError: [Errno 13] Permission denied: '../../docs/libvirt-api.xml' make[5]: *** [../../docs/apibuild.py.stamp] Error 1 and fixing that exposed another case of a distributed file (generated html) depending on a built file (libvirt.h), but only when doing an in-tree build, because of a file glob. * src/Makefile.am ($(srcdir)/remote/remote_driver.c): Change... (libvirt_driver_remote_la-remote_driver.lo): ...to the real dependency. ($(builddir)/locking/%-sanlock.conf): Drop $(builddir), so that rule gets run in time for test_libvirt_sanlock.aug. (test_libvir*.aug): Cater to silent build. (conf_DATA): Don't ship qemu-sanlock.conf in the tarball, since it is trivial to regenerate. * docs/Makefile.am (EXTRA_DIST): Ship our stamp file. ($(APIBUILD_STAMP)): Don't depend on generated file.
2012-05-30 17:30:18 +00:00
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
$(AM_V_GEN)$(MKDIR_P) locking ; \
cp $< $@
if WITH_QEMU
nodist_conf_DATA += locking/qemu-sanlock.conf
BUILT_SOURCES += locking/qemu-sanlock.conf
DISTCLEANFILES += locking/qemu-sanlock.conf
endif WITH_QEMU
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
else ! WITH_SANLOCK
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
endif ! WITH_SANLOCK
EXTRA_DIST += locking/sanlock.conf \
locking/libvirt_sanlock.aug \
locking/test_libvirt_sanlock.aug.in
noinst_LTLIBRARIES += \
libvirt-net-rpc.la \
libvirt-net-rpc-server.la \
libvirt-net-rpc-client.la
libvirt_la_BUILT_LIBADD += \
libvirt-net-rpc.la \
libvirt-net-rpc-server.la \
libvirt-net-rpc-client.la
EXTRA_DIST += \
dtrace2systemtap.pl \
rpc/gendispatch.pl \
rpc/genprotocol.pl \
rpc/gensystemtap.pl \
rpc/virnetprotocol.x \
rpc/virkeepaliveprotocol.x
VIR_NET_RPC_GENERATED = \
rpc/virnetprotocol.h \
rpc/virnetprotocol.c \
rpc/virkeepaliveprotocol.h \
rpc/virkeepaliveprotocol.c
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
libvirt_net_rpc_la_SOURCES = \
rpc/virnetmessage.h rpc/virnetmessage.c \
rpc/virnetsocket.h rpc/virnetsocket.c \
rpc/virkeepalive.h rpc/virkeepalive.c \
$(VIR_NET_RPC_GENERATED)
2013-01-08 21:34:15 +00:00
if WITH_SSH2
libvirt_net_rpc_la_SOURCES += \
rpc/virnetsshsession.h rpc/virnetsshsession.c
else ! WITH_SSH2
EXTRA_DIST += \
rpc/virnetsshsession.h rpc/virnetsshsession.c
endif ! WITH_SSH2
2013-01-08 21:02:05 +00:00
if WITH_GNUTLS
libvirt_net_rpc_la_SOURCES += \
rpc/virnettlscontext.h rpc/virnettlscontext.c
else ! WITH_GNUTLS
EXTRA_DIST += \
rpc/virnettlscontext.h rpc/virnettlscontext.c
endif ! WITH_GNUTLS
if WITH_SASL
libvirt_net_rpc_la_SOURCES += \
rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
else ! WITH_SASL
EXTRA_DIST += \
rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
endif ! WITH_SASL
if WITH_LIBSSH
libvirt_net_rpc_la_SOURCES += \
rpc/virnetlibsshsession.h rpc/virnetlibsshsession.c
else ! WITH_LIBSSH
EXTRA_DIST += \
rpc/virnetlibsshsession.h rpc/virnetlibsshsession.c
endif ! WITH_LIBSSH
libvirt_net_rpc_la_CFLAGS = \
$(GNUTLS_CFLAGS) \
$(SASL_CFLAGS) \
$(SSH2_CFLAGS) \
$(LIBSSH_CFLAGS) \
$(XDR_CFLAGS) \
$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
$(GNUTLS_LIBS) \
$(SASL_LIBS) \
$(SSH2_LIBS)\
$(LIBSSH_LIBS) \
build: fix linking virt-login-shell After commit 3e2f27e1, I've noticed build failures of virt-login-shell when libapparmor-devel is installed on the build host CCLD virt-login-shell ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o): In function `virExec': /home/jfehlig/virt/upstream/libvirt/src/util/vircommand.c:653: undefined reference to `aa_change_profile' collect2: error: ld returned 1 exit status I was about to commit an easy fix under the build-breaker rule (build-fix-1.patch), but thought to extend the notion of SECDRIVER_LIBS to SECDRIVER_CFLAGS, and use both throughout src/Makefile.am where it makes sense (build-fix-2.patch). Should I just stick with the simple fix, or is something along the lines of patch 2 preferred? Regards, Jim >From a0f35945f3127ab70d051101037e821b1759b4bb Mon Sep 17 00:00:00 2001 From: Jim Fehlig <jfehlig@suse.com> Date: Mon, 21 Oct 2013 15:30:02 -0600 Subject: [PATCH] build: fix virt-login-shell build with apparmor With libapparmor-devel installed, virt-login-shell fails to link CCLD virt-login-shell ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o): In function `virExec': /home/jfehlig/virt/upstream/libvirt/src/util/vircommand.c:653: undefined reference to `aa_change_profile' collect2: error: ld returned 1 exit status Fix by linking libvirt_setuid_rpc_client with previously determined SECDRIVER_LIBS in src/Makefile.am. While at it, introduce SECDRIVER_CFLAGS and use both throughout src/Makefile.am where it makes sense. Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2013-10-21 21:36:11 +00:00
$(SECDRIVER_LIBS) \
$(AM_LDFLAGS) \
$(NULL)
libvirt_net_rpc_la_LIBADD = \
$(CYGWIN_EXTRA_LIBADD)
libvirt_net_rpc_server_la_SOURCES = \
rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
rpc/virnetserverservice.h rpc/virnetserverservice.c \
rpc/virnetserverclient.h rpc/virnetserverclient.c \
rpc/virnetservermdns.h rpc/virnetservermdns.c \
rpc/virnetdaemon.h rpc/virnetdaemon.c \
rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
$(AVAHI_CFLAGS) \
$(DBUS_CFLAGS) \
$(XDR_CFLAGS) \
$(AM_CFLAGS)
libvirt_net_rpc_server_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(AVAHI_LIBS) \
$(DBUS_LIBS) \
$(NULL)
libvirt_net_rpc_server_la_LIBADD = \
$(CYGWIN_EXTRA_LIBADD)
libvirt_net_rpc_client_la_SOURCES = \
rpc/virnetclientprogram.h rpc/virnetclientprogram.c \
rpc/virnetclientstream.h rpc/virnetclientstream.c \
rpc/virnetclient.h rpc/virnetclient.c
libvirt_net_rpc_client_la_CFLAGS = \
$(AM_CFLAGS) \
$(XDR_CFLAGS)
libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_net_rpc_client_la_LIBADD = \
$(CYGWIN_EXTRA_LIBADD)
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
libvirt_iohelper_LDFLAGS = \
$(AM_LDFLAGS) \
$(PIE_LDFLAGS) \
$(NULL)
libvirt_iohelper_LDADD = \
libvirt_util.la \
../gnulib/lib/libgnu.la
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES
libvirt_iohelper_CFLAGS = \
$(AM_CFLAGS) \
$(PIE_CFLAGS) \
$(NULL)
endif WITH_LIBVIRTD
if WITH_SANLOCK
libexec_PROGRAMS += libvirt_sanlock_helper
libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
libvirt_sanlock_helper_CFLAGS = \
-I$(srcdir)/conf \
$(AM_CFLAGS) \
$(PIE_CFLAGS) \
$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
$(AM_LDFLAGS) \
$(PIE_LDFLAGS) \
$(NULL)
libvirt_sanlock_helper_LDADD = libvirt.la
endif WITH_SANLOCK
if WITH_SECDRIVER_APPARMOR
if WITH_LIBVIRTD
libexec_PROGRAMS += virt-aa-helper
virt_aa_helper_SOURCES = $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)
virt_aa_helper_LDFLAGS = \
$(AM_LDFLAGS) \
$(PIE_LDFLAGS) \
$(NULL)
virt_aa_helper_LDADD = \
libvirt.la \
libvirt_conf.la \
libvirt_util.la \
libvirt_driver_storage_impl.la \
../gnulib/lib/libgnu.la
if WITH_DTRACE_PROBES
virt_aa_helper_LDADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES
virt_aa_helper_CFLAGS = \
-I$(srcdir)/conf \
-I$(srcdir)/security \
$(AM_CFLAGS) \
$(PIE_CFLAGS) \
$(NULL)
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)
if WITH_NSS
noinst_LTLIBRARIES += libvirt-nss.la
libvirt_nss_la_SOURCES = \
util/viralloc.c \
util/viralloc.h \
util/viratomic.c \
util/viratomic.h \
util/virbitmap.c \
util/virbitmap.h \
util/virbuffer.c \
util/virbuffer.h \
util/vircommand.c \
util/vircommand.h \
util/virerror.c \
util/virerror.h \
util/virfile.c \
util/virfile.h \
util/virhash.c \
util/virhash.h \
util/virhashcode.c \
util/virhashcode.h \
util/virjson.c \
util/virjson.h \
util/virkmod.c \
util/virkmod.h \
util/virlease.c \
util/virlease.h \
util/virlog.c \
util/virlog.h \
util/virmacmap.c \
util/virmacmap.h \
util/virobject.c \
util/virobject.h \
util/virpidfile.c \
util/virpidfile.h \
util/virprocess.c \
util/virprocess.h \
util/virrandom.c \
util/virrandom.h \
util/virsocketaddr.c \
util/virsocketaddr.h \
util/virstring.c \
util/virstring.h \
util/virthread.c \
util/virthread.h \
util/virthreadjob.c \
util/virthreadjob.h \
util/virtime.c \
util/virtime.h \
util/virutil.c \
util/virutil.h \
$(NULL)
libvirt_nss_la_CFLAGS = \
-DLIBVIRT_NSS \
$(AM_CFLAGS) \
$(YAJL_CFLAGS) \
$(NULL)
libvirt_nss_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(NULL)
libvirt_nss_la_LIBADD = \
$(YAJL_LIBS) \
$(NULL)
endif WITH_NSS
install-data-local: install-init install-systemd install-upstart \
install-sysctl install-polkit install-sasl \
install-logrotate $(INSTALL_DATA_DIRS:%=install-data-%)
if WITH_LIBVIRTD
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
endif WITH_LIBVIRTD
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
if WITH_SANLOCK
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
endif WITH_SANLOCK
uninstall-local:: uninstall-init uninstall-systemd uninstall-upstart \
uninstall-sysctl uninstall-polkit uninstall-sasl \
uninstall-logrotate $(INSTALL_DATA_DIRS:%=uninstall-data-%)
if WITH_LIBVIRTD
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
endif WITH_LIBVIRTD
rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
if WITH_SANLOCK
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
endif WITH_SANLOCK
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
Rewrite all the DTrace/SystemTAP probing The libvirtd daemon had a few crude system tap probes. Some of these were broken during the RPC rewrite. The new modular RPC code is structured in a way that allows much more effective tracing. Instead of trying to hook up the original probes, define a new set of probes for the RPC and event code. The master probes file is now src/probes.d. This contains probes for virNetServerClientPtr, virNetClientPtr, virSocketPtr virNetTLSContextPtr and virNetTLSSessionPtr modules. Also add probes for the poll event loop. The src/dtrace2systemtap.pl script can convert the probes.d file into a libvirt_probes.stp file to make use from systemtap much simpler. The src/rpc/gensystemtap.pl script can generate a set of systemtap functions for translating RPC enum values into printable strings. This works for all RPC header enums (program, type, status, procedure) and also the authentication enum The PROBE macro will automatically generate a VIR_DEBUG statement, so any place with a PROBE can remove any existing manual DEBUG statements. * daemon/libvirtd.stp, daemon/probes.d: Remove obsolete probing * daemon/libvirtd.h: Remove probe macros * daemon/Makefile.am: Remove all probe buildings/install * daemon/remote.c: Update authentication probes * src/dtrace2systemtap.pl, src/rpc/gensystemtap.pl: Scripts to generate STP files * src/internal.h: Add probe macros * src/probes.d: Master list of probes * src/rpc/virnetclient.c, src/rpc/virnetserverclient.c, src/rpc/virnetsocket.c, src/rpc/virnettlscontext.c, src/util/event_poll.c: Insert probe points, removing any DEBUG statements that duplicate the info
2011-09-30 13:40:23 +00:00
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
MAINTAINERCLEANFILES += \
$(VIR_NET_RPC_GENERATED) \
$(NULL)