[vdsm] update to vdsm-4.10.3-16

Federico Simoncelli fsimonce at fedoraproject.org
Wed Apr 24 16:08:54 UTC 2013


commit 205ef3f211be1cffe0120f0efef9c8a2e633fbdb
Author: Federico Simoncelli <fsimonce at redhat.com>
Date:   Wed Apr 24 18:07:06 2013 +0200

    update to vdsm-4.10.3-16
    
    - Don't user sudo in fuser
    - svdsm: fix fuser import in supervdsmServer
    - Removing vdsm configuration when removing vdsm service
    - Seperating supervdsm log to supervdsm.log file
    - vdsm.spec: Adding with_systemd macro
    - spec: use the fedora systemd macros
    - spec: enable gluster upstream and on fedora 19

 0041-Don-t-user-sudo-in-fuser.patch                |   94 +++++++++
 ...svdsm-fix-fuser-import-in-supervdsmServer.patch |   31 +++
 ...sm-configuration-when-removing-vdsm-servi.patch |   62 ++++++
 ...ating-supervdsm-log-to-supervdsm.log-file.patch |  144 +++++++++++++
 0045-vdsm.spec-Adding-with_systemd-macro.patch     |  124 +++++++++++
 0046-spec-use-the-fedora-systemd-macros.patch      |  140 +++++++++++++
 ...-enable-gluster-upstream-and-on-fedora-19.patch |   64 ++++++
 vdsm.spec                                          |  219 +++++++++++++-------
 8 files changed, 803 insertions(+), 75 deletions(-)
---
diff --git a/0041-Don-t-user-sudo-in-fuser.patch b/0041-Don-t-user-sudo-in-fuser.patch
new file mode 100644
index 0000000..7dc6d32
--- /dev/null
+++ b/0041-Don-t-user-sudo-in-fuser.patch
@@ -0,0 +1,94 @@
+From 1576791841cdb21c95bea65f214c333cb4c188ac Mon Sep 17 00:00:00 2001
+From: Saggi Mizrahi <smizrahi at redhat.com>
+Date: Wed, 10 Apr 2013 10:56:01 +0300
+Subject: [PATCH 41/47] Don't user sudo in fuser
+
+Change-Id: I74842ffda1bc1d5ebb54de5e1933fedd851e745b
+Signed-off-by: Saggi Mizrahi <smizrahi at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/13779
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Tested-by: Antoni Segura Puimedon <asegurap at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/13810
+Reviewed-by: Federico Simoncelli <fsimonce at redhat.com>
+Tested-by: Federico Simoncelli <fsimonce at redhat.com>
+---
+ vdsm/storage/blockSD.py | 5 +++--
+ vdsm/storage/fuser.py   | 2 +-
+ vdsm/sudoers.vdsm.in    | 1 -
+ vdsm/supervdsmServer.py | 5 +++++
+ 4 files changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
+index e66256d..e22a1e2 100644
+--- a/vdsm/storage/blockSD.py
++++ b/vdsm/storage/blockSD.py
+@@ -48,7 +48,7 @@ import storage_exception as se
+ from storage_mailbox import MAILBOX_SIZE
+ import resourceManager as rm
+ import mount
+-from fuser import fuser
++import supervdsm as svdsm
+ 
+ STORAGE_DOMAIN_TAG = "RHAT_storage_domain"
+ STORAGE_UNREADY_DOMAIN_TAG = STORAGE_DOMAIN_TAG + "_UNREADY"
+@@ -1122,7 +1122,8 @@ class BlockStorageDomain(sd.StorageDomain):
+                 masterMount.umount()
+             except mount.MountError:
+                 # umount failed, try to kill that processes holding mount point
+-                pids = fuser(masterMount.fs_file, mountPoint=True)
++                svdsmp = svdsm.getProxy()
++                pids = svdsmp.fuser(masterMount.fs_file, mountPoint=True)
+ 
+                 # It was unmounted while I was checking no need to do anything
+                 if not masterMount.isMounted():
+diff --git a/vdsm/storage/fuser.py b/vdsm/storage/fuser.py
+index 135dad6..0f235ee 100644
+--- a/vdsm/storage/fuser.py
++++ b/vdsm/storage/fuser.py
+@@ -27,7 +27,7 @@ def fuser(path, mountPoint=False):
+         cmd.append("-m")
+ 
+     cmd.append(path)
+-    (rc, out, err) = misc.execCmd(cmd, raw=True, sudo=True)
++    (rc, out, err) = misc.execCmd(cmd, raw=True, sudo=False)
+     if rc != 0:
+         return []
+ 
+diff --git a/vdsm/sudoers.vdsm.in b/vdsm/sudoers.vdsm.in
+index 4fc75f9..70628f8 100644
+--- a/vdsm/sudoers.vdsm.in
++++ b/vdsm/sudoers.vdsm.in
+@@ -12,7 +12,6 @@ Cmnd_Alias VDSM_STORAGE = @MOUNT_PATH@, @UMOUNT_PATH@, \
+     @FSCK_PATH@ -p *, \
+     @TUNE2FS_PATH@ -j *, \
+     @MKFS_PATH@ -q -j *, \
+-    @FUSER_PATH@ -m *, \
+     @KILL_PATH@, \
+     @CHOWN_PATH@ @VDSMUSER@\:@QEMUGROUP@ *, \
+     @CHOWN_PATH@ @METADATAUSER@\:@METADATAGROUP@ *, \
+diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py
+index 21e7c94..3f7ce1c 100755
+--- a/vdsm/supervdsmServer.py
++++ b/vdsm/supervdsmServer.py
+@@ -26,6 +26,7 @@ import stat
+ import errno
+ import threading
+ import re
++import fuser
+ from time import sleep
+ import signal
+ from multiprocessing import Pipe, Process
+@@ -307,6 +308,10 @@ class _SuperVdsm(object):
+     def removeFs(self, path):
+         return mkimage.removeFs(path)
+ 
++    @logDecorator
++    def fuser(self, *args):
++        return fuser.fuser(*args)
++
+     def __udevReloadRules(self, guid):
+         if self.__udevOperationReload():
+             reload = "--reload"
+-- 
+1.8.1.4
+
diff --git a/0042-svdsm-fix-fuser-import-in-supervdsmServer.patch b/0042-svdsm-fix-fuser-import-in-supervdsmServer.patch
new file mode 100644
index 0000000..06dd3c4
--- /dev/null
+++ b/0042-svdsm-fix-fuser-import-in-supervdsmServer.patch
@@ -0,0 +1,31 @@
+From acd99086f6f7d0b2f94065806be6faaee0f41f46 Mon Sep 17 00:00:00 2001
+From: Federico Simoncelli <fsimonce at redhat.com>
+Date: Thu, 11 Apr 2013 05:15:56 -0400
+Subject: [PATCH 42/47] svdsm: fix fuser import in supervdsmServer
+
+Change-Id: I319a96e1357b5ed47ef5b6bcf3dec0ce678b9748
+Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/13804
+Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/13811
+---
+ vdsm/supervdsmServer.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py
+index 3f7ce1c..949a7cc 100755
+--- a/vdsm/supervdsmServer.py
++++ b/vdsm/supervdsmServer.py
+@@ -26,7 +26,7 @@ import stat
+ import errno
+ import threading
+ import re
+-import fuser
++from storage import fuser
+ from time import sleep
+ import signal
+ from multiprocessing import Pipe, Process
+-- 
+1.8.1.4
+
diff --git a/0043-Removing-vdsm-configuration-when-removing-vdsm-servi.patch b/0043-Removing-vdsm-configuration-when-removing-vdsm-servi.patch
new file mode 100644
index 0000000..0536202
--- /dev/null
+++ b/0043-Removing-vdsm-configuration-when-removing-vdsm-servi.patch
@@ -0,0 +1,62 @@
+From b7743c5593b72d1e669a8ace7a5a657fb9eb8643 Mon Sep 17 00:00:00 2001
+From: Yaniv Bronhaim <ybronhei at redhat.com>
+Date: Thu, 7 Feb 2013 11:00:03 +0200
+Subject: [PATCH 43/47] Removing vdsm configuration when removing vdsm service
+
+Before we removed that section only over rhel and we looked for the
+wrong string. This patch adds sed command for both dist with the current
+string that is written by vdsmd init script.
+
+Change-Id: Ia8f59375e20efa6b5de8483a12a772f5f0ce3749
+Bug-Id: https://bugzilla.redhat.com/show_bug.cgi?id=902346
+Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/11295
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-by: Douglas Schilling Landgraf <dougsland at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/13812
+Reviewed-by: Federico Simoncelli <fsimonce at redhat.com>
+Tested-by: Federico Simoncelli <fsimonce at redhat.com>
+---
+ vdsm.spec.in | 20 ++++++++++++++------
+ 1 file changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/vdsm.spec.in b/vdsm.spec.in
+index 4bc4c6e..f8a2924 100644
+--- a/vdsm.spec.in
++++ b/vdsm.spec.in
+@@ -529,18 +529,26 @@ exit 0
+ %endif
+ 
+ %preun
++if [ "$1" -eq 0 ]; then
++        start_conf_section="## beginning of configuration section by vdsm"
++        end_conf_section="## end of configuration section by vdsm"
++        by_vdsm="by vdsm"
++
++        /bin/sed -i -e "/${start_conf_section}/,/${end_conf_section}/d" \
++                    -e "/${by_vdsm}/d" \
++               %{_sysconfdir}/libvirt/libvirtd.conf \
++               %{_sysconfdir}/libvirt/qemu.conf \
++               %{_sysconfdir}/sysconfig/libvirtd \
++               %{_sysconfdir}/sysctl.conf \
++               %{_sysconfdir}/libvirt/qemu-sanlock.conf
++fi
++
+ %if 0%{?rhel}
+ if [ "$1" -eq 0 ]
+ then
+     /sbin/service vdsmd stop > /dev/null 2>&1 || :
+     /sbin/chkconfig --del vdsmd
+ 
+-    /bin/sed -i '/# by vdsm$/d' \
+-        /etc/libvirt/libvirtd.conf \
+-        /etc/libvirt/qemu.conf \
+-        /etc/sysconfig/libvirtd \
+-        /etc/sysctl.conf
+-
+     /bin/sed -i '/# VDSM section begin/,/# VDSM section end/d' \
+         /etc/sysctl.conf
+ 
+-- 
+1.8.1.4
+
diff --git a/0044-Seperating-supervdsm-log-to-supervdsm.log-file.patch b/0044-Seperating-supervdsm-log-to-supervdsm.log-file.patch
new file mode 100644
index 0000000..6dd59f7
--- /dev/null
+++ b/0044-Seperating-supervdsm-log-to-supervdsm.log-file.patch
@@ -0,0 +1,144 @@
+From baf505e8698f38fdeeb152ffe1d4377f94a39231 Mon Sep 17 00:00:00 2001
+From: Yaniv Bronhaim <ybronhei at redhat.com>
+Date: Wed, 17 Apr 2013 09:44:40 +0300
+Subject: [PATCH 44/47] Seperating supervdsm log to supervdsm.log file
+
+Supervdsm as root process can change the logfile ownership
+to root when creating the file. Manual deletion of vdsm.log can cause
+this scenario.
+
+Change-Id: I2e5fb4a2cd5421671f942120b6718c1bb20b9e60
+Bug-Id: https://bugzilla.redhat.com/show_bug.cgi?id=912308
+Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Reviewed-on: https://gerrit.eng.lab.tlv.redhat.com/7190
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/13964
+---
+ vdsm.spec.in              |  1 +
+ vdsm/Makefile.am          |  5 +++++
+ vdsm/logger.conf.in       |  8 +-------
+ vdsm/supervdsmServer.py   |  2 +-
+ vdsm/svdsm.logger.conf.in | 29 +++++++++++++++++++++++++++++
+ 6 files changed, 38 insertions(+), 8 deletions(-)
+ create mode 100644 vdsm/svdsm.logger.conf.in
+
+diff --git a/vdsm.spec.in b/vdsm.spec.in
+index f8a2924..0120c3e 100644
+--- a/vdsm.spec.in
++++ b/vdsm.spec.in
+@@ -668,6 +668,7 @@ exit 0
+ %attr (755,vdsm,kvm) %{_datadir}/%{vdsm_name}/dummybr.py*
+ %attr (755,vdsm,kvm) %{_datadir}/%{vdsm_name}/nwfilter.py*
+ %config(noreplace) %{_sysconfdir}/%{vdsm_name}/logger.conf
++%config(noreplace) %{_sysconfdir}/%{vdsm_name}/svdsm.logger.conf
+ %config(noreplace) %{_sysconfdir}/%{vdsm_name}/mom.conf
+ %config(noreplace) %{_sysconfdir}/%{vdsm_name}/mom.policy
+ %config(noreplace) %{_sysconfdir}/logrotate.d/vdsm
+diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
+index 88b3287..382eaf5 100644
+--- a/vdsm/Makefile.am
++++ b/vdsm/Makefile.am
+@@ -86,6 +86,7 @@ nodist_vdsm_SCRIPTS = \
+ 
+ nodist_noinst_DATA = \
+ 	logger.conf \
++	svdsm.logger.conf \
+ 	mom.conf \
+ 	sudoers.vdsm \
+ 	vdsm-logrotate.conf \
+@@ -124,6 +125,7 @@ EXTRA_DIST = \
+ 	libvirt_password \
+ 	limits.conf \
+ 	logger.conf.in \
++	svdsm.logger.conf.in \
+ 	mk_sysprep_floppy.in \
+ 	mom.conf.in \
+ 	mom.policy \
+@@ -188,9 +190,12 @@ uninstall-local: \
+ install-data-logger:
+ 	$(MKDIR_P) $(DESTDIR)$(vdsmconfdir)
+ 	$(INSTALL_DATA) logger.conf $(DESTDIR)$(vdsmconfdir)/logger.conf
++	$(INSTALL_DATA) svdsm.logger.conf \
++		$(DESTDIR)$(vdsmconfdir)/svdsm.logger.conf
+ 
+ uninstall-data-logger:
+ 	$(RM) $(DESTDIR)$(vdsmconfdir)/logger.conf
++	$(RM) $(DESTDIR)$(vdsmconfdir)/svdsm.logger.conf
+ 
+ install-data-libvirtpass:
+ 	$(MKDIR_P) $(DESTDIR)$(vdsmtsdir)/keys
+diff --git a/vdsm/logger.conf.in b/vdsm/logger.conf.in
+index edd4616..0a4622f 100644
+--- a/vdsm/logger.conf.in
++++ b/vdsm/logger.conf.in
+@@ -1,5 +1,5 @@
+ [loggers]
+-keys=root,vds,Storage,metadata,SuperVdsm
++keys=root,vds,Storage,metadata
+ 
+ [handlers]
+ keys=console,syslog,logfile,metadata
+@@ -24,12 +24,6 @@ handlers=syslog,logfile
+ qualname=Storage
+ propagate=0
+ 
+-[logger_SuperVdsm]
+-level=DEBUG
+-handlers=syslog,logfile
+-qualname=SuperVdsm
+-propagate=0
+-
+ [logger_metadata]
+ level=WARNING
+ handlers=metadata
+diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py
+index 949a7cc..db6b778 100755
+--- a/vdsm/supervdsmServer.py
++++ b/vdsm/supervdsmServer.py
+@@ -84,7 +84,7 @@ def logDecorator(func):
+ 
+ KB = 2 ** 10
+ TEST_BUFF_LEN = 4 * KB
+-LOG_CONF_PATH = "/etc/vdsm/logger.conf"
++LOG_CONF_PATH = "/etc/vdsm/svdsm.logger.conf"
+ 
+ 
+ class _SuperVdsm(object):
+diff --git a/vdsm/svdsm.logger.conf.in b/vdsm/svdsm.logger.conf.in
+new file mode 100644
+index 0000000..3728170
+--- /dev/null
++++ b/vdsm/svdsm.logger.conf.in
+@@ -0,0 +1,29 @@
++[loggers]
++keys=root,SuperVdsm
++
++[handlers]
++keys=logfile
++
++[formatters]
++keys=long
++
++[logger_root]
++level=DEBUG
++handlers=logfile
++propagate=0
++
++[logger_SuperVdsm]
++level=DEBUG
++handlers=logfile
++qualname=SuperVdsm
++propagate=0
++
++[handler_logfile]
++class=logging.handlers.WatchedFileHandler
++args=('@VDSMLOGDIR@/supervdsm.log',)
++filters=storage.misc.TracebackRepeatFilter
++level=DEBUG
++formatter=long
++
++[formatter_long]
++format: %(threadName)s::%(levelname)s::%(asctime)s::%(module)s::%(lineno)d::%(name)s::(%(funcName)s) %(message)s
+-- 
+1.8.1.4
+
diff --git a/0045-vdsm.spec-Adding-with_systemd-macro.patch b/0045-vdsm.spec-Adding-with_systemd-macro.patch
new file mode 100644
index 0000000..059adcc
--- /dev/null
+++ b/0045-vdsm.spec-Adding-with_systemd-macro.patch
@@ -0,0 +1,124 @@
+From 20becc2c3174ab500f4bce4f75a9604de30c9c35 Mon Sep 17 00:00:00 2001
+From: Douglas Schilling Landgraf <dougsland at redhat.com>
+Date: Mon, 4 Mar 2013 16:18:24 -0500
+Subject: [PATCH 45/47] vdsm.spec: Adding with_systemd macro
+
+This patch adds the macro with_systemd which can be used
+to validate if the system uses Systemd.
+
+Change-Id: Ibcd8567868e16453ed6633f143a6b1fff8e9c454
+Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/12086
+Tested-by: oVirt Jenkins CI Server
+Reviewed-by: Vinzenz Feenstra <vfeenstr at redhat.com>
+Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/13814
+Reviewed-by: Federico Simoncelli <fsimonce at redhat.com>
+---
+ vdsm.spec.in | 45 ++++++++++++++++++++++++++++++---------------
+ 1 file changed, 30 insertions(+), 15 deletions(-)
+
+diff --git a/vdsm.spec.in b/vdsm.spec.in
+index 0120c3e..d7944cb 100644
+--- a/vdsm.spec.in
++++ b/vdsm.spec.in
+@@ -20,6 +20,15 @@
+ %global _polkitdir %{_localstatedir}/lib/polkit-1/localauthority/10-vendor.d
+ %endif
+ 
++# Systemd macro
++%if 0%{?fedora} >= 15
++%global with_systemd 1
++%endif
++
++%if 0%{?rhel} >= 7
++%global with_systemd 1
++%endif
++
+ # 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.
+@@ -66,6 +75,9 @@ BuildRequires: libtool
+ %if !0%{?rhel}
+ BuildRequires: pyflakes
+ BuildRequires: python-pep8
++%endif
++
++%if 0%{?with_systemd}
+ BuildRequires: systemd-units
+ %endif
+ 
+@@ -454,11 +466,21 @@ install -Dm 0644 vdsm/storage/12-vdsm-lvm.rules \
+ install -Dm 0644 vdsm/limits.conf \
+                  %{buildroot}/etc/security/limits.d/99-vdsm.conf
+ 
+-%if 0%{?rhel}
++%if 0%{?with_systemd}
++# Install the systemd scripts
++install -Dm 0755 vdsm/vdsmd.init %{buildroot}/lib/systemd/systemd-vdsmd
++install -Dm 0644 vdsm/vdsmd.service %{buildroot}%{_unitdir}/vdsmd.service
++install -Dm 0755 vdsm_reg/vdsm-reg.init \
++                 %{buildroot}/lib/systemd/systemd-vdsm-reg
++install -Dm 0644 vdsm_reg/vdsm-reg.service \
++                 %{buildroot}%{_unitdir}/vdsm-reg.service
++%else
+ # Install the SysV init scripts
+ install -Dm 0755 vdsm/vdsmd.init %{buildroot}%{_initrddir}/vdsmd
+ install -Dm 0755 vdsm_reg/vdsm-reg.init %{buildroot}%{_initrddir}/vdsm-reg
++%endif
+ 
++%if 0%{?rhel}
+ # This is not commonplace, but we want /var/log/core to be a world-writable
+ # dropbox for core dumps
+ install -dDm 1777 %{buildroot}%{_localstatedir}/log/core
+@@ -467,14 +489,6 @@ install -dDm 1777 %{buildroot}%{_localstatedir}/log/core
+ install -Dm 0644 vdsm/vdsm.conf.sample \
+                  %{buildroot}%{_sysconfdir}/vdsm/vdsm.conf
+ 
+-# Install the systemd scripts
+-install -Dm 0755 vdsm/vdsmd.init %{buildroot}/lib/systemd/systemd-vdsmd
+-install -Dm 0644 vdsm/vdsmd.service %{buildroot}%{_unitdir}/vdsmd.service
+-install -Dm 0755 vdsm_reg/vdsm-reg.init \
+-                 %{buildroot}/lib/systemd/systemd-vdsm-reg
+-install -Dm 0644 vdsm_reg/vdsm-reg.service \
+-                 %{buildroot}%{_unitdir}/vdsm-reg.service
+-
+ # Install the polkit for libvirt
+ %if 0%{?fedora} >= 18
+ install -Dm 0644 vdsm/vdsm-libvirt-access.rules \
+@@ -628,12 +642,13 @@ exit 0
+ %files
+ %defattr(-, root, root, -)
+ %doc COPYING README vdsm/vdsm.conf.sample
+-%if 0%{?rhel}
+-%{_initrddir}/vdsmd
+-%else
++%if 0%{?with_systemd}
+ /lib/systemd/systemd-vdsmd
+ %{_unitdir}/vdsmd.service
++%else
++%{_initrddir}/vdsmd
+ %endif
++
+ %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@
+ %ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@/hsm-tasks
+ %ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@/mnt
+@@ -981,11 +996,11 @@ exit 0
+ %config(noreplace) %{_sysconfdir}/%{vdsm_reg}/logger.conf
+ %ghost %dir /data
+ %ghost %dir %attr(0775, root, root) /data/updates
+-%if 0%{?rhel}
+-%{_initrddir}/vdsm-reg
+-%else
++%if 0%{?with_systemd}
+ /lib/systemd/systemd-vdsm-reg
+ %{_unitdir}/vdsm-reg.service
++%else
++%{_initrddir}/vdsm-reg
+ %endif
+ %{_datadir}/%{vdsm_reg}/vdsm-reg-setup
+ %{_datadir}/%{vdsm_reg}/vdsm-complete
+-- 
+1.8.1.4
+
diff --git a/0046-spec-use-the-fedora-systemd-macros.patch b/0046-spec-use-the-fedora-systemd-macros.patch
new file mode 100644
index 0000000..b130923
--- /dev/null
+++ b/0046-spec-use-the-fedora-systemd-macros.patch
@@ -0,0 +1,140 @@
+From d848def9d4e011c234675130c9588c86e6f6a411 Mon Sep 17 00:00:00 2001
+From: Federico Simoncelli <fsimonce at redhat.com>
+Date: Thu, 21 Feb 2013 09:22:01 -0500
+Subject: [PATCH 46/47] spec: use the fedora systemd macros
+
+Add the support for the fedora systemd macros introduced in fedora 18.
+
+Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=850412
+Change-Id: I76857a6b9ae1a945511f359333735b9497c5e2b0
+Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/12285
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/13815
+Tested-by: Douglas Schilling Landgraf <dougsland at redhat.com>
+Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
+---
+ vdsm.spec.in | 33 ++++++++++++++++++++++++++-------
+ 1 file changed, 26 insertions(+), 7 deletions(-)
+
+diff --git a/vdsm.spec.in b/vdsm.spec.in
+index d7944cb..e8f4876 100644
+--- a/vdsm.spec.in
++++ b/vdsm.spec.in
+@@ -3,9 +3,6 @@
+ %global vdsm_bootstrap vdsm-bootstrap
+ %global vdsm_reg vdsm-reg
+ 
+-# Gluster
+-%global with_gluster 1
+-
+ # Required users and groups
+ %global vdsm_user @VDSMUSER@
+ %global vdsm_group @VDSMGROUP@
+@@ -20,13 +17,15 @@
+ %global _polkitdir %{_localstatedir}/lib/polkit-1/localauthority/10-vendor.d
+ %endif
+ 
+-# Systemd macro
+-%if 0%{?fedora} >= 15
++# Gluster
++%global with_gluster 1
++
++%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+ %global with_systemd 1
+ %endif
+ 
+-%if 0%{?rhel} >= 7
+-%global with_systemd 1
++%if 0%{?fedora} >= 18
++%global with_systemd_macros 1
+ %endif
+ 
+ # Default to skipping autoreconf.  Distros can change just this one line
+@@ -535,12 +534,16 @@ if [ "$1" -eq 1 ] ; then
+     /sbin/chkconfig --add vdsmd
+ fi
+ %else
++%if 0%{?with_systemd_macros}
++%systemd_post vdsmd.service
++%else
+ if [ "$1" -eq 1 ] ; then
+     /bin/systemctl enable vdsmd.service >/dev/null 2>&1 || :
+     /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+ fi
+ exit 0
+ %endif
++%endif
+ 
+ %preun
+ if [ "$1" -eq 0 ]; then
+@@ -579,12 +582,16 @@ then
+     fi
+ fi
+ %else
++%if 0%{?with_systemd_macros}
++%systemd_preun vdsmd.service
++%else
+ if [ "$1" -eq 0 ]; then
+     /bin/systemctl --no-reload disable vdsmd.service > /dev/null 2>&1 || :
+     /bin/systemctl stop vdsmd.service > /dev/null 2>&1 || :
+ fi
+ exit 0
+ %endif
++%endif
+ 
+ %postun
+ %if 0%{?rhel}
+@@ -593,11 +600,15 @@ if [ "$1" -ge 1 ]; then
+ fi
+ exit 0
+ %else
++%if 0%{?with_systemd_macros}
++%systemd_postun_with_restart vdsmd.service
++%else
+ if [ "$1" -ge 1 ] ; then
+     /bin/systemctl try-restart vdsmd.service >/dev/null 2>&1 || :
+ fi
+ exit 0
+ %endif
++%endif
+ 
+ %if 0%{?rhel}
+ %triggerun -- libvirt
+@@ -617,12 +628,16 @@ if [ "$1" -eq 1 ] ; then
+     /sbin/chkconfig --add vdsm-reg
+ fi
+ %else
++%if 0%{?with_systemd_macros}
++%systemd_post vdsm-reg.service
++%else
+ if [ "$1" -eq 1 ] ; then
+     /bin/systemctl enable vdsm-reg.service >/dev/null 2>&1 || :
+     /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+ fi
+ exit 0
+ %endif
++%endif
+ 
+ %preun reg
+ %if 0%{?rhel}
+@@ -632,12 +647,16 @@ then
+     /sbin/chkconfig --del vdsm-reg
+ fi
+ %else
++%if 0%{?with_systemd_macros}
++%systemd_preun vdsm-reg.service
++%else
+ if [ "$1" -eq 0 ]; then
+     /bin/systemctl --no-reload disable vdsm-reg.service > /dev/null 2>&1 || :
+     /bin/systemctl stop vdsm-reg.service > /dev/null 2>&1 || :
+ fi
+ exit 0
+ %endif
++%endif
+ 
+ %files
+ %defattr(-, root, root, -)
+-- 
+1.8.1.4
+
diff --git a/0047-spec-enable-gluster-upstream-and-on-fedora-19.patch b/0047-spec-enable-gluster-upstream-and-on-fedora-19.patch
new file mode 100644
index 0000000..258f1f5
--- /dev/null
+++ b/0047-spec-enable-gluster-upstream-and-on-fedora-19.patch
@@ -0,0 +1,64 @@
+From 7fd5b70e91f59d396da79b44ae1dc6edba2c7d49 Mon Sep 17 00:00:00 2001
+From: Federico Simoncelli <fsimonce at redhat.com>
+Date: Wed, 10 Apr 2013 11:41:06 -0400
+Subject: [PATCH 47/47] spec: enable gluster upstream and on fedora 19
+
+The gluster package should be always enabled upstream or since fedora 19
+in koji builds.
+
+Change-Id: I68436bf10cecdaea8b3ce6c95797aac4895ec482
+Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/13791
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/13816
+Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Tested-by: Douglas Schilling Landgraf <dougsland at redhat.com>
+---
+ vdsm.spec.in | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/vdsm.spec.in b/vdsm.spec.in
+index e8f4876..9a44260 100644
+--- a/vdsm.spec.in
++++ b/vdsm.spec.in
+@@ -10,6 +10,14 @@
+ %global snlk_group @SNLKGROUP@
+ %global snlk_user @SNLKUSER@
+ 
++# Fedora official build
++%global fedora_koji_build 0
++
++# 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}
++
+ # Required paths
+ %if 0%{?fedora} >= 18
+ %global _polkitdir %{_datadir}/polkit-1/rules.d
+@@ -17,8 +25,9 @@
+ %global _polkitdir %{_localstatedir}/lib/polkit-1/localauthority/10-vendor.d
+ %endif
+ 
+-# Gluster
++%if !0%{fedora_koji_build} || 0%{?fedora} >= 19
+ %global with_gluster 1
++%endif
+ 
+ %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+ %global with_systemd 1
+@@ -28,11 +37,6 @@
+ %global with_systemd_macros 1
+ %endif
+ 
+-# 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}
+-
+ Name:           %{vdsm_name}
+ Version:        @PACKAGE_VERSION@
+ Release:        @PACKAGE_RELEASE@%{?dist}%{?extra_release}
+-- 
+1.8.1.4
+
diff --git a/vdsm.spec b/vdsm.spec
index 3821c03..7a37557 100644
--- a/vdsm.spec
+++ b/vdsm.spec
@@ -3,14 +3,6 @@
 %global vdsm_bootstrap vdsm-bootstrap
 %global vdsm_reg vdsm-reg
 
-# Upstream git release
-# % global vdsm_release gf2f6683
-# % global vdsm_relvtag .git%{vdsm_release}
-# % global vdsm_relttag -%{vdsm_release}
-
-# Gluster
-%global with_gluster 0
-
 # Required users and groups
 %global vdsm_user vdsm
 %global vdsm_group kvm
@@ -18,9 +10,20 @@
 %global snlk_group sanlock
 %global snlk_user sanlock
 
-# Fedora specific configuration
+# Upstream git release
+# % global vdsm_release gf2f6683
+# % global vdsm_relvtag .git%{vdsm_release}
+# % global vdsm_relttag -%{vdsm_release}
+
+# Fedora official build
+%global fedora_koji_build 1
 %global with_hooks 1
 
+# 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 1}
+
 # Required paths
 %if 0%{?fedora} >= 18
 %global _polkitdir %{_datadir}/polkit-1/rules.d
@@ -28,14 +31,21 @@
 %global _polkitdir %{_localstatedir}/lib/polkit-1/localauthority/10-vendor.d
 %endif
 
-# 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 1}
+%if !0%{fedora_koji_build} || 0%{?fedora} >= 19
+%global with_gluster 1
+%endif
+
+%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+%global with_systemd 1
+%endif
+
+%if 0%{?fedora} >= 18
+%global with_systemd_macros 1
+%endif
 
 Name:           %{vdsm_name}
 Version:        4.10.3
-Release:        15%{?vdsm_relvtag}%{?dist}%{?extra_release}
+Release:        16%{?vdsm_relvtag}%{?dist}%{?extra_release}
 Summary:        Virtual Desktop Server Manager
 
 Group:          Applications/System
@@ -93,6 +103,13 @@ Patch36:        0037-vdsm.spec-fence-agents-all.patch
 Patch37:        0038-fix-storage.fuser.patch
 Patch38:        0039-Bump-up-libvirt-version-to-fix-network-linking.patch
 Patch39:        0040-vdsm.spec.in-with_gluster.patch
+Patch40:        0041-Don-t-user-sudo-in-fuser.patch
+Patch41:        0042-svdsm-fix-fuser-import-in-supervdsmServer.patch
+Patch42:        0043-Removing-vdsm-configuration-when-removing-vdsm-servi.patch
+Patch43:        0044-Seperating-supervdsm-log-to-supervdsm.log-file.patch
+Patch44:        0045-vdsm.spec-Adding-with_systemd-macro.patch
+Patch45:        0046-spec-use-the-fedora-systemd-macros.patch
+Patch46:        0047-spec-enable-gluster-upstream-and-on-fedora-19.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -126,6 +143,9 @@ BuildRequires: libtool
 %if !0%{?rhel}
 BuildRequires: pyflakes
 BuildRequires: python-pep8
+%endif
+
+%if 0%{?with_systemd}
 BuildRequires: systemd-units
 %endif
 
@@ -486,46 +506,53 @@ Gluster plugin enables VDSM to serve Gluster functionalities.
 %setup -q
 
 # ovirt-3.2 patches
-%patch0 -p1 -b .patch0
-%patch1 -p1 -b .patch1
-%patch2 -p1 -b .patch2
-%patch3 -p1 -b .patch3
-%patch4 -p1 -b .patch4
-%patch5 -p1 -b .patch5
-%patch6 -p1 -b .patch6
-%patch7 -p1 -b .patch7
-%patch8 -p1 -b .patch8
-%patch9 -p1 -b .patch9
-%patch10 -p1 -b .patch10
-%patch11 -p1 -b .patch11
-%patch12 -p1 -b .patch12
-%patch13 -p1 -b .patch13
-%patch14 -p1 -b .patch14
-%patch15 -p1 -b .patch15
-%patch16 -p1 -b .patch16
-%patch17 -p1 -b .patch17
-%patch18 -p1 -b .patch18
-%patch19 -p1 -b .patch19
-%patch20 -p1 -b .patch20
-%patch21 -p1 -b .patch21
-%patch22 -p1 -b .patch22
-%patch23 -p1 -b .patch23
-%patch24 -p1 -b .patch24
-%patch25 -p1 -b .patch25
-%patch26 -p1 -b .patch26
-%patch27 -p1 -b .patch27
-%patch28 -p1 -b .patch28
-%patch29 -p1 -b .patch29
-%patch30 -p1 -b .patch30
-%patch31 -p1 -b .patch31
-%patch32 -p1 -b .patch32
-%patch33 -p1 -b .patch33
-%patch34 -p1 -b .patch34
-%patch35 -p1 -b .patch35
-%patch36 -p1 -b .patch36
-%patch37 -p1 -b .patch37
-%patch38 -p1 -b .patch38
-%patch39 -p1 -b .patch39
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
+%patch13 -p1
+%patch14 -p1
+%patch15 -p1
+%patch16 -p1
+%patch17 -p1
+%patch18 -p1
+%patch19 -p1
+%patch20 -p1
+%patch21 -p1
+%patch22 -p1
+%patch23 -p1
+%patch24 -p1
+%patch25 -p1
+%patch26 -p1
+%patch27 -p1
+%patch28 -p1
+%patch29 -p1
+%patch30 -p1
+%patch31 -p1
+%patch32 -p1
+%patch33 -p1
+%patch34 -p1
+%patch35 -p1
+%patch36 -p1
+%patch37 -p1
+%patch38 -p1
+%patch39 -p1
+%patch40 -p1
+%patch41 -p1
+%patch42 -p1
+%patch43 -p1
+%patch44 -p1
+%patch45 -p1
+%patch46 -p1
 
 %if 0%{?rhel} == 6
 sed -i '/ su /d' vdsm/vdsm-logrotate.conf.in
@@ -558,11 +585,21 @@ install -Dm 0644 vdsm/storage/12-vdsm-lvm.rules \
 install -Dm 0644 vdsm/limits.conf \
                  %{buildroot}/etc/security/limits.d/99-vdsm.conf
 
-%if 0%{?rhel}
+%if 0%{?with_systemd}
+# Install the systemd scripts
+install -Dm 0755 vdsm/vdsmd.init %{buildroot}/lib/systemd/systemd-vdsmd
+install -Dm 0644 vdsm/vdsmd.service %{buildroot}%{_unitdir}/vdsmd.service
+install -Dm 0755 vdsm_reg/vdsm-reg.init \
+                 %{buildroot}/lib/systemd/systemd-vdsm-reg
+install -Dm 0644 vdsm_reg/vdsm-reg.service \
+                 %{buildroot}%{_unitdir}/vdsm-reg.service
+%else
 # Install the SysV init scripts
 install -Dm 0755 vdsm/vdsmd.init %{buildroot}%{_initrddir}/vdsmd
 install -Dm 0755 vdsm_reg/vdsm-reg.init %{buildroot}%{_initrddir}/vdsm-reg
+%endif
 
+%if 0%{?rhel}
 # This is not commonplace, but we want /var/log/core to be a world-writable
 # dropbox for core dumps
 install -dDm 1777 %{buildroot}%{_localstatedir}/log/core
@@ -571,14 +608,6 @@ install -dDm 1777 %{buildroot}%{_localstatedir}/log/core
 install -Dm 0644 vdsm/vdsm.conf.sample \
                  %{buildroot}%{_sysconfdir}/vdsm/vdsm.conf
 
-# Install the systemd scripts
-install -Dm 0755 vdsm/vdsmd.init %{buildroot}/lib/systemd/systemd-vdsmd
-install -Dm 0644 vdsm/vdsmd.service %{buildroot}%{_unitdir}/vdsmd.service
-install -Dm 0755 vdsm_reg/vdsm-reg.init \
-                 %{buildroot}/lib/systemd/systemd-vdsm-reg
-install -Dm 0644 vdsm_reg/vdsm-reg.service \
-                 %{buildroot}%{_unitdir}/vdsm-reg.service
-
 # Install the polkit for libvirt
 %if 0%{?fedora} >= 18
 install -Dm 0644 vdsm/vdsm-libvirt-access.rules \
@@ -627,26 +656,38 @@ if [ "$1" -eq 1 ] ; then
     /sbin/chkconfig --add vdsmd
 fi
 %else
+%if 0%{?with_systemd_macros}
+%systemd_post vdsmd.service
+%else
 if [ "$1" -eq 1 ] ; then
     /bin/systemctl enable vdsmd.service >/dev/null 2>&1 || :
     /bin/systemctl daemon-reload >/dev/null 2>&1 || :
 fi
 exit 0
 %endif
+%endif
 
 %preun
+if [ "$1" -eq 0 ]; then
+        start_conf_section="## beginning of configuration section by vdsm"
+        end_conf_section="## end of configuration section by vdsm"
+        by_vdsm="by vdsm"
+
+        /bin/sed -i -e "/${start_conf_section}/,/${end_conf_section}/d" \
+                    -e "/${by_vdsm}/d" \
+               %{_sysconfdir}/libvirt/libvirtd.conf \
+               %{_sysconfdir}/libvirt/qemu.conf \
+               %{_sysconfdir}/sysconfig/libvirtd \
+               %{_sysconfdir}/sysctl.conf \
+               %{_sysconfdir}/libvirt/qemu-sanlock.conf
+fi
+
 %if 0%{?rhel}
 if [ "$1" -eq 0 ]
 then
     /sbin/service vdsmd stop > /dev/null 2>&1 || :
     /sbin/chkconfig --del vdsmd
 
-    /bin/sed -i '/# by vdsm$/d' \
-        /etc/libvirt/libvirtd.conf \
-        /etc/libvirt/qemu.conf \
-        /etc/sysconfig/libvirtd \
-        /etc/sysctl.conf
-
     /bin/sed -i '/# VDSM section begin/,/# VDSM section end/d' \
         /etc/sysctl.conf
 
@@ -663,12 +704,16 @@ then
     fi
 fi
 %else
+%if 0%{?with_systemd_macros}
+%systemd_preun vdsmd.service
+%else
 if [ "$1" -eq 0 ]; then
     /bin/systemctl --no-reload disable vdsmd.service > /dev/null 2>&1 || :
     /bin/systemctl stop vdsmd.service > /dev/null 2>&1 || :
 fi
 exit 0
 %endif
+%endif
 
 %postun
 %if 0%{?rhel}
@@ -677,11 +722,15 @@ if [ "$1" -ge 1 ]; then
 fi
 exit 0
 %else
+%if 0%{?with_systemd_macros}
+%systemd_postun_with_restart vdsmd.service
+%else
 if [ "$1" -ge 1 ] ; then
     /bin/systemctl try-restart vdsmd.service >/dev/null 2>&1 || :
 fi
 exit 0
 %endif
+%endif
 
 %if 0%{?rhel}
 %triggerun -- libvirt
@@ -701,12 +750,16 @@ if [ "$1" -eq 1 ] ; then
     /sbin/chkconfig --add vdsm-reg
 fi
 %else
+%if 0%{?with_systemd_macros}
+%systemd_post vdsm-reg.service
+%else
 if [ "$1" -eq 1 ] ; then
     /bin/systemctl enable vdsm-reg.service >/dev/null 2>&1 || :
     /bin/systemctl daemon-reload >/dev/null 2>&1 || :
 fi
 exit 0
 %endif
+%endif
 
 %preun reg
 %if 0%{?rhel}
@@ -716,22 +769,27 @@ then
     /sbin/chkconfig --del vdsm-reg
 fi
 %else
+%if 0%{?with_systemd_macros}
+%systemd_preun vdsm-reg.service
+%else
 if [ "$1" -eq 0 ]; then
     /bin/systemctl --no-reload disable vdsm-reg.service > /dev/null 2>&1 || :
     /bin/systemctl stop vdsm-reg.service > /dev/null 2>&1 || :
 fi
 exit 0
 %endif
+%endif
 
 %files
 %defattr(-, root, root, -)
 %doc COPYING README vdsm/vdsm.conf.sample
-%if 0%{?rhel}
-%{_initrddir}/vdsmd
-%else
+%if 0%{?with_systemd}
 /lib/systemd/systemd-vdsmd
 %{_unitdir}/vdsmd.service
+%else
+%{_initrddir}/vdsmd
 %endif
+
 %dir %attr(-, %{vdsm_user}, %{vdsm_group}) /rhev/data-center
 %ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) /rhev/data-center/hsm-tasks
 %ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) /rhev/data-center/mnt
@@ -766,6 +824,7 @@ exit 0
 %attr (755,vdsm,kvm) %{_datadir}/%{vdsm_name}/dummybr.py*
 %attr (755,vdsm,kvm) %{_datadir}/%{vdsm_name}/nwfilter.py*
 %config(noreplace) %{_sysconfdir}/%{vdsm_name}/logger.conf
+%config(noreplace) %{_sysconfdir}/%{vdsm_name}/svdsm.logger.conf
 %config(noreplace) %{_sysconfdir}/%{vdsm_name}/mom.conf
 %config(noreplace) %{_sysconfdir}/%{vdsm_name}/mom.policy
 %config(noreplace) %{_sysconfdir}/logrotate.d/vdsm
@@ -1078,11 +1137,11 @@ exit 0
 %config(noreplace) %{_sysconfdir}/%{vdsm_reg}/logger.conf
 %ghost %dir /data
 %ghost %dir %attr(0775, root, root) /data/updates
-%if 0%{?rhel}
-%{_initrddir}/vdsm-reg
-%else
+%if 0%{?with_systemd}
 /lib/systemd/systemd-vdsm-reg
 %{_unitdir}/vdsm-reg.service
+%else
+%{_initrddir}/vdsm-reg
 %endif
 %{_datadir}/%{vdsm_reg}/vdsm-reg-setup
 %{_datadir}/%{vdsm_reg}/vdsm-complete
@@ -1123,7 +1182,17 @@ exit 0
 %exclude %{_datadir}/%{vdsm_name}/gluster/*
 %endif
 
+
 %changelog
+* Tue Apr 23 2013 Federico Simoncelli <fsimonce at redhat.com> 4.10.3-16
+- Don't user sudo in fuser
+- svdsm: fix fuser import in supervdsmServer
+- Removing vdsm configuration when removing vdsm service
+- Seperating supervdsm log to supervdsm.log file
+- vdsm.spec: Adding with_systemd macro
+- spec: use the fedora systemd macros
+- spec: enable gluster upstream and on fedora 19
+
 * Tue Apr  9 2013 Federico Simoncelli <fsimonce at redhat.com> 4.10.3-15
 - fix the patches backported to ovirt-3.2
 - resync the fedora spec file with the upstream one


More information about the scm-commits mailing list