Add correct patch for fixing module linkage & enable autotools

Add the correct patch to fix the module linkage problems
and enable autotools, so the Makefile.am changes actually
get applied
This commit is contained in:
Daniel P. Berrange 2012-08-14 16:19:00 +01:00
parent 76c8282ee2
commit 438006407c
2 changed files with 122 additions and 2 deletions

View File

@ -0,0 +1,115 @@
From 2f2ca021951905439fbb47ae02d0796837eb4f53 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 2 Aug 2012 14:10:31 +0200
Subject: [PATCH] build: Link security manager into libvirt.so
Security manager is not a dynamically loadable driver, it's a common
infrastructure similar to util, conf, cpu, etc. used by individual
drivers. Such code is allowed to be linked into libvirt.so.
This reverts commit ec5b7bd2ecbf40ceff5b2d4fc00d5cfdfba966a4 and most of
aae5cfb69948fddef556f8f5b9f80a444f9c6125.
This patch is supposed to fix virdrivermoduletest failures for qemu and
lxc drivers as well as libvirtd's ability to load qemu and lxc drivers.
---
daemon/Makefile.am | 1 -
src/Makefile.am | 3 +--
src/libvirt_private.syms | 31 +++++++++++++++++++++++++++++++
tests/Makefile.am | 5 ++---
4 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index b8ecbef..928aeaf 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -164,7 +164,6 @@ endif
if WITH_NWFILTER
libvirtd_LDADD += ../src/libvirt_driver_nwfilter.la
endif
-libvirtd_LDADD += ../src/libvirt_driver_security.la
endif
libvirtd_LDADD += ../src/libvirt.la
diff --git a/src/Makefile.am b/src/Makefile.am
index 844e648..7663ad7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1161,8 +1161,7 @@ endif
libvirt_driver_security_la_SOURCES = $(SECURITY_DRIVER_SOURCES)
noinst_LTLIBRARIES += libvirt_driver_security.la
-# Stateful, so linked to daemon instead
-#libvirt_la_BUILT_LIBADD += libvirt_driver_security.la
+libvirt_la_BUILT_LIBADD += libvirt_driver_security.la
libvirt_driver_security_la_CFLAGS = \
-I$(top_srcdir)/src/conf $(AM_CFLAGS)
libvirt_driver_security_la_LDFLAGS = $(AM_LDFLAGS)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 0b026b8..aace748 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -961,6 +961,37 @@ virSecretUsageTypeTypeFromString;
virSecretUsageTypeTypeToString;
+# security_driver.h
+virSecurityDriverLookup;
+
+
+# security_manager.h
+virSecurityManagerClearSocketLabel;
+virSecurityManagerFree;
+virSecurityManagerGenLabel;
+virSecurityManagerGetDOI;
+virSecurityManagerGetModel;
+virSecurityManagerGetProcessLabel;
+virSecurityManagerNew;
+virSecurityManagerNewStack;
+virSecurityManagerNewDAC;
+virSecurityManagerReleaseLabel;
+virSecurityManagerReserveLabel;
+virSecurityManagerRestoreImageLabel;
+virSecurityManagerRestoreAllLabel;
+virSecurityManagerRestoreHostdevLabel;
+virSecurityManagerRestoreSavedStateLabel;
+virSecurityManagerSetAllLabel;
+virSecurityManagerSetDaemonSocketLabel;
+virSecurityManagerSetImageFDLabel;
+virSecurityManagerSetImageLabel;
+virSecurityManagerSetHostdevLabel;
+virSecurityManagerSetProcessLabel;
+virSecurityManagerSetSavedStateLabel;
+virSecurityManagerSetSocketLabel;
+virSecurityManagerVerify;
+virSecurityManagerGetMountOptions;
+
# sexpr.h
sexpr_append;
sexpr_cons;
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6a1b18b..ac26bc5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -295,8 +295,7 @@ endif
if WITH_QEMU
-qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la \
- ../src/libvirt_driver_security.la
+qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
if WITH_NETWORK
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
endif
@@ -521,7 +520,7 @@ virauthconfigtest_LDADD = $(LDADDS)
seclabeltest_SOURCES = \
seclabeltest.c
-seclabeltest_LDADD = $(LDADDS) ../src/libvirt_driver_security.la
+seclabeltest_LDADD = $(LDADDS)
virbuftest_SOURCES = \
virbuftest.c testutils.h testutils.c
--
1.7.11.2

View File

@ -11,7 +11,7 @@
# Default to skipping autoreconf. Distros can change just this one line
# (or provide a command-line override) if they backport any patches that
# touch configure.ac or Makefile.am.
%{!?enable_autotools:%define enable_autotools 0}
%{!?enable_autotools:%define enable_autotools 1}
# A client only build will create a libvirt.so only containing
# the generic RPC driver, and test driver and no libvirtd
@ -309,7 +309,7 @@
Summary: Library providing a simple virtualization API
Name: libvirt
Version: 0.10.0
Release: 0rc0.1%{?dist}%{?extra_release}
Release: 0rc0.2%{?dist}%{?extra_release}
License: LGPLv2+
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@ -321,6 +321,7 @@ URL: http://libvirt.org/
Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}-rc0.tar.gz
Patch0: libvirt-0.10.0-rc0-release-naming.patch
Patch1: libvirt-build-Link-security-driver-into-daemon.patch
Patch2: build-Link-security-manager-into-libvirt.so.patch
%if %{with_libvirtd}
Requires: libvirt-daemon = %{version}-%{release}
@ -1024,6 +1025,7 @@ of recent versions of Linux (and other OSes).
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
%if ! %{with_xen}
@ -1846,6 +1848,9 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
%endif
%changelog
* Tue Aug 14 2012 Daniel P. Berrange <berrange@redhat.com> - 0.10.0-0rc0.2
- Enable autotools to make previous patch work
* Tue Aug 14 2012 Daniel Veillard <veillard@redhat.com> - 0.10.0-0rc0.1
- fix security driver missing from the daemon