Change in vdsm[master]: change vdsm to use multipolicy mom

lvroyce at linux.vnet.ibm.com lvroyce at linux.vnet.ibm.com
Mon Jan 21 09:07:03 UTC 2013


Royce Lv has uploaded a new change for review.

Change subject: change vdsm to use multipolicy mom
......................................................................

change vdsm to use multipolicy mom

To support multipolicy, all policies will be placed
in directory '/etc/vdsm/mom-policy-dir' instead of in a single file.
At startup mom will load all policy files under this directory.

Change-Id: If06b7f5d5bb69767b0d97c1063c44ae2bd9cd799
Signed-off-by: Royce Lv<lvroyce at linux.vnet.ibm.com>
---
M vdsm.spec.in
M vdsm/Makefile.am
M vdsm/mom.conf.in
R vdsm/mom_policies/mom.policy
4 files changed, 13 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/43/11243/1

diff --git a/vdsm.spec.in b/vdsm.spec.in
index 632d315..4c82e9c 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -109,7 +109,7 @@
 Requires: kernel >= 2.6.32-279.9.1
 Requires: sanlock >= 2.3-4, sanlock-python
 Requires: initscripts >= 9.03.31-2.el6_3.1
-Requires: mom >= 0.3.0
+Requires: mom >= 0.3.1
 Requires: selinux-policy-targeted >= 3.7.19-155
 Requires: lvm2 >= 2.02.95-10.el6_3.2
 Requires: logrotate < 3.8.0
@@ -124,7 +124,7 @@
 Requires: device-mapper-multipath >= 0.4.9-18
 Requires: e2fsprogs >= 1.41.14
 Requires: kernel >= 3.6
-Requires: mom >= 0.3.0
+Requires: mom >= 0.3.1
 Requires: sanlock >= 2.4-2, sanlock-python
 Requires: sed >= 4.2.1-10
 Requires: selinux-policy-targeted >= 3.10.0-149
@@ -646,7 +646,7 @@
 %attr (755,vdsm,kvm) %{_datadir}/%{vdsm_name}/nwfilter.py*
 %config(noreplace) %{_sysconfdir}/%{vdsm_name}/logger.conf
 %config(noreplace) %{_sysconfdir}/%{vdsm_name}/mom.conf
-%config(noreplace) %{_sysconfdir}/%{vdsm_name}/mom.policy
+%config(noreplace) %{_sysconfdir}/%{vdsm_name}/mom-policy-dir/mom.policy
 %config(noreplace) %{_sysconfdir}/logrotate.d/vdsm
 %config(noreplace) %{_sysconfdir}/rwtab.d/vdsm
 %config(noreplace) %{_sysconfdir}/sysctl.d/vdsm
diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
index 88b3287..3b57693 100644
--- a/vdsm/Makefile.am
+++ b/vdsm/Makefile.am
@@ -126,7 +126,7 @@
 	logger.conf.in \
 	mk_sysprep_floppy.in \
 	mom.conf.in \
-	mom.policy \
+	mom_policies/mom.policy \
 	sudoers.vdsm.in \
 	vdsmd.8.in \
 	vdsmd.init.in \
@@ -225,13 +225,14 @@
 	$(RM) $(DESTDIR)$(sysconfdir)/cron.d/vdsm-libvirt-logrotate
 
 install-data-mom:
-		$(INSTALL_DATA) mom.policy \
-			$(DESTDIR)$(vdsmconfdir)/mom.policy
+		$(MKDIR_P) $(DESTDIR)$(vdsmconfdir)/mom-policy-dir
+		$(INSTALL_DATA) mom_policies/mom.policy \
+			$(DESTDIR)$(vdsmconfdir)/mom-policy-dir/mom.policy
 		$(INSTALL_DATA) mom.conf \
 			$(DESTDIR)$(vdsmconfdir)/mom.conf
 
 uninstall-data-mom:
-		$(RM) $(DESTDIR)$(vdsmconfdir)/mom.policy
+		$(RM) $(DESTDIR)$(vdsmconfdir)/mom-policy-dir/mom.policy
 		$(RM) $(DESTDIR)$(vdsmconfdir)/mom.conf
 
 install-data-sudoers:
diff --git a/vdsm/mom.conf.in b/vdsm/mom.conf.in
index 264eda4..7fca830 100644
--- a/vdsm/mom.conf.in
+++ b/vdsm/mom.conf.in
@@ -41,8 +41,11 @@
 # disabled by default until authentication is added to the protocol.
 rpc-port: -1
 
-# At startup, load a policy from the given file.  If empty, no policy is loaded
-policy: @CONFDIR@/mom.policy
+# At startup, load policies from the given directory.  Only filenames matching
+# *.policy will be considered.  Each loaded policy will be named according to
+# the file's basename.  Policies are concatenated in alphabetical order by name
+# for evaluation.
+policy-dir: @CONFDIR@/mom-policy-dir
 
 [logging]
 # Set the destination for program log messages.  This can be either 'stdio' or
diff --git a/vdsm/mom.policy b/vdsm/mom_policies/mom.policy
similarity index 100%
rename from vdsm/mom.policy
rename to vdsm/mom_policies/mom.policy


--
To view, visit http://gerrit.ovirt.org/11243
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If06b7f5d5bb69767b0d97c1063c44ae2bd9cd799
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce at linux.vnet.ibm.com>


More information about the vdsm-patches mailing list