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@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@/ovirt_functions.sh
+LIBVIRT_SANLOCK="@LIBVIRT_SANLOCK@" +LIBVIRT_SELINUX="@LIBVIRT_SELINUX@" + GETCONFITEM="@VDSMDIR@/get-conf-item" VDSM_CONF_FILE="@CONFDIR@/vdsm.conf" QEMU_DUMP_PATH="/var/log/core" @@ -27,6 +30,7 @@ QCONF="@sysconfdir@/libvirt/qemu.conf" LDCONF="@sysconfdir@/sysconfig/libvirtd" QLCONF="@sysconfdir@/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}"
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Packaging: libvirt plugin of selinux and sanlock usage is configurable at build time ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4293/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3396/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4212/ : SUCCESS
Zhou Zheng Sheng has posted comments on this change.
Change subject: Packaging: libvirt plugin of selinux and sanlock usage is configurable at build time ......................................................................
Patch Set 1: Verified+1
Test on Fedora and Ubuntu. This patch is needed by http://gerrit.ovirt.org/#/c/18443/ .
Alon Bar-Lev has posted comments on this change.
Change subject: Packaging: libvirt plugin of selinux and sanlock usage is configurable at build time ......................................................................
Patch Set 1:
(1 comment)
.................................................... File configure.ac Line 60: yes) libvirt_sanlock=true ;; Line 61: no) libvirt_sanlock=false ;; Line 62: *) AC_MSG_ERROR([bad value ${enableval} for --enable-libvirt-sanlock]) ;; Line 63: esac],[libvirt_sanlock=true]) Line 64: AC_SUBST([LIBVIRT_SANLOCK], [$libvirt_sanlock]) this is ugly... well, the entire autoconf, but as we have only with enable... better we can fix it now...
should be:
AC_ARG_ENABLE( [libvirt-sanlock], [AS_HELP_STRING([--enable-libvirt-sanlock], [enable libvirt sanlock plugin @<:@default=yes@:>@])], , [enable_libvirt_sanlock="yes"] ) AC_SUBST([ENABLE_LIBVIRT_SANLOCK], [${enable_libvirt_sanlock}])
or:
AC_ARG_ENABLE( [libvirt-sanlock], [AS_HELP_STRING([--enable-libvirt-sanlock], [enable libvirt sanlock plugin @<:@default=yes@:>@])], [ENABLE_LIBVIRT_SANLOCK="${enableval}"], [ENABLE_LIBVIRT_SANLOCK="yes"] ) AC_SUBST([ENABLE_LIBVIRT_SANLOCK])
and you will have enable_libvirt_sanlock with no if disabled, use standard 'yes'/'no' as values, xxx != 'no'...
I would also have fixed the above hooks statement in different patch... :) Line 65: Line 66: AC_ARG_ENABLE([libvirt-selinux], Line 67: [ --enable-libvirt-sanlock enable libvirt selinux plugin, default yes], Line 68: [case "${enableval}" in
Alon Bar-Lev has posted comments on this change.
Change subject: Packaging: libvirt plugin of selinux and sanlock usage is configurable at build time ......................................................................
Patch Set 1:
(1 comment)
.................................................... File configure.ac Line 60: yes) libvirt_sanlock=true ;; Line 61: no) libvirt_sanlock=false ;; Line 62: *) AC_MSG_ERROR([bad value ${enableval} for --enable-libvirt-sanlock]) ;; Line 63: esac],[libvirt_sanlock=true]) Line 64: AC_SUBST([LIBVIRT_SANLOCK], [$libvirt_sanlock]) You can also use empty vs non empty variable if this how you prefer, then you can conditional -z or -n at shell...
AC_ARG_ENABLE( [libvirt-sanlock], [AS_HELP_STRING([--enable-libvirt-sanlock], [enable libvirt sanlock plugin @<:@default=yes@:>@])], [test ${enableval} = "yes" && ENABLE_LIBVIRT_SANLOCK="1" || ENABLE_LIBVIRT_SANLOCK=""], [ENABLE_LIBVIRT_SANLOCK="1"] ) AC_SUBST([ENABLE_LIBVIRT_SANLOCK])
or you can put '#' like the AM_CONDITIONAL... then have:
$(ENABLE_LIBVIRT_SANLOCK)command
:) Line 65: Line 66: AC_ARG_ENABLE([libvirt-selinux], Line 67: [ --enable-libvirt-sanlock enable libvirt selinux plugin, default yes], Line 68: [case "${enableval}" in
Zhou Zheng Sheng has posted comments on this change.
Change subject: Packaging: libvirt plugin of selinux and sanlock usage is configurable at build time ......................................................................
Patch Set 1:
(1 comment)
Thanks for the advice.
.................................................... File configure.ac Line 60: yes) libvirt_sanlock=true ;; Line 61: no) libvirt_sanlock=false ;; Line 62: *) AC_MSG_ERROR([bad value ${enableval} for --enable-libvirt-sanlock]) ;; Line 63: esac],[libvirt_sanlock=true]) Line 64: AC_SUBST([LIBVIRT_SANLOCK], [$libvirt_sanlock]) I will submit a new version based on your suggestion. If you submit the fix for hooks configuration ahead of me. I'd happy to rebase on yours, then follow the same style. Line 65: Line 66: AC_ARG_ENABLE([libvirt-selinux], Line 67: [ --enable-libvirt-sanlock enable libvirt selinux plugin, default yes], Line 68: [case "${enableval}" in
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Packaging: libvirt plugin of selinux and sanlock usage is configurable at build time ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4295/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3398/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4214/ : SUCCESS
Alon Bar-Lev has posted comments on this change.
Change subject: Packaging: libvirt plugin of selinux and sanlock usage is configurable at build time ......................................................................
Patch Set 2:
Dan,
This is the reason... the AC_ARG_ENABLE is related... :)
Thanks,
Alon
Dan Kenigsberg has posted comments on this change.
Change subject: Packaging: libvirt plugin of selinux and sanlock usage is configurable at build time ......................................................................
Patch Set 3: Verified+1 Code-Review+2
/me hates long lines.
Dan Kenigsberg has submitted this change and it was merged.
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 --enable-libvirt-sanlock
By default they are both enabled.
Because of non standard use of substitution (not using AC_OUTPUT) the scripts that are effected will not be regenerated unless make clean is called, out of the scope of this patch.
Change-Id: I0953942999e5e77054c3c8f4f2b48e9cfd31fa61 Signed-off-by: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Signed-off-by: Alon Bar-Lev alonbl@redhat.com Reviewed-on: http://gerrit.ovirt.org/18921 Reviewed-by: Dan Kenigsberg danken@redhat.com Tested-by: Dan Kenigsberg danken@redhat.com --- M configure.ac M lib/vdsm/tool/libvirt_configure.sh.in 2 files changed, 30 insertions(+), 3 deletions(-)
Approvals: Dan Kenigsberg: Verified; Looks good to me, approved
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Packaging: libvirt plugin of selinux and sanlock usage is configurable at build time ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4299/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3402/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4218/ : SUCCESS
vdsm-patches@lists.fedorahosted.org