Zhou Zheng Sheng has uploaded a new change for review.
Change subject: Packaging: libvirt plugin of selinux and sanlock usage is configurable at
build time
......................................................................
Packaging: libvirt plugin of selinux and sanlock usage is configurable at build time
VDSM makes use of these two plugins. However on platform such as Ubuntu,
libvirt is compiled without selinux and sanlock plugin. In this patch we
make these plugins configurable at build time by
--enable-libvirt-selinux=no|yes
--enable-libvirt-sanlock=no|yes
By default they are both yes.
Change-Id: I0953942999e5e77054c3c8f4f2b48e9cfd31fa61
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
M configure.ac
M lib/vdsm/tool/libvirt_configure.sh.in
2 files changed, 30 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/21/18921/1
diff --git a/configure.ac b/configure.ac
index 4d8f4da..be7ddd9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,6 +54,24 @@
esac],[hooks=false])
AM_CONDITIONAL([HOOKS], [test x$hooks = xtrue])
+AC_ARG_ENABLE([libvirt-sanlock],
+[ --enable-libvirt-sanlock enable libvirt sanlock plugin, default yes],
+[case "${enableval}" in
+ yes) libvirt_sanlock=true ;;
+ no) libvirt_sanlock=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-libvirt-sanlock]) ;;
+esac],[libvirt_sanlock=true])
+AC_SUBST([LIBVIRT_SANLOCK], [$libvirt_sanlock])
+
+AC_ARG_ENABLE([libvirt-selinux],
+[ --enable-libvirt-sanlock enable libvirt selinux plugin, default yes],
+[case "${enableval}" in
+ yes) libvirt_selinux=true ;;
+ no) libvirt_selinux=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-libvirt-selinux]) ;;
+esac],[libvirt_selinux=true])
+AC_SUBST([LIBVIRT_SELINUX], [$libvirt_selinux])
+
# Users and groups
AC_SUBST([VDSMUSER], [vdsm])
AC_SUBST([VDSMGROUP], [kvm])
diff --git a/lib/vdsm/tool/libvirt_configure.sh.in
b/lib/vdsm/tool/libvirt_configure.sh.in
index 3a4f4fa..cf74173 100755
--- a/lib/vdsm/tool/libvirt_configure.sh.in
+++ b/lib/vdsm/tool/libvirt_configure.sh.in
@@ -20,6 +20,9 @@
. @LIBEXECDIR(a)/ovirt_functions.sh
+LIBVIRT_SANLOCK="@LIBVIRT_SANLOCK@"
+LIBVIRT_SELINUX="@LIBVIRT_SELINUX@"
+
GETCONFITEM="@VDSMDIR@/get-conf-item"
VDSM_CONF_FILE="@CONFDIR(a)/vdsm.conf"
QEMU_DUMP_PATH="/var/log/core"
@@ -27,6 +30,7 @@
QCONF="@sysconfdir(a)/libvirt/qemu.conf"
LDCONF="@sysconfdir@/sysconfig/libvirtd"
QLCONF="@sysconfdir(a)/libvirt/qemu-sanlock.conf"
+[ "${LIBVIRT_SANLOCK}" = "false" ] &&
QLCONF="/dev/null"
# trigger for reconfiguration
FORCE_RECONFIGURE="@VDSMLIBDIR@/reconfigure"
@@ -204,6 +208,9 @@
set_if_default "${lconf}" host_uuid "\"$(uuidgen)\""
set_if_default "${lconf}" keepalive_interval -1
set_if_default "${qconf}" dynamic_ownership 0
+ if [ "${LIBVIRT_SELINUX}" = "false" ]; then
+ set_if_default "${qconf}" security_driver \"none\"
+ fi
if [ "${ssl}" = "true" ]; then
set_if_default "${qconf}" spice_tls 1
@@ -235,9 +242,11 @@
fi
# Configuring sanlock
- set_if_default "${qconf}" lock_manager \"sanlock\"
- set_if_default "${qlconf}" auto_disk_leases 0
- set_if_default "${qlconf}" require_lease_for_disks 0
+ if [ "${LIBVIRT_SANLOCK}" != "false" ]; then
+ set_if_default "${qconf}" lock_manager \"sanlock\"
+ set_if_default "${qlconf}" auto_disk_leases 0
+ set_if_default "${qlconf}" require_lease_for_disks 0
+ fi
# Configuring auto dump path
set_if_default "${qconf}" auto_dump_path \"${QEMU_DUMP_PATH}\"
--
To view, visit
http://gerrit.ovirt.org/18921
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0953942999e5e77054c3c8f4f2b48e9cfd31fa61
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>