[vdsm] vdsm 4.13.0-14

Yaniv Bronhaim bronhaim at fedoraproject.org
Mon Dec 9 20:34:57 UTC 2013


commit 234e9a34dae18776e05e3b5b1a37d614a82da521
Author: Yaniv Bronhaim <ybronhei at redhat.com>
Date:   Mon Dec 9 22:36:22 2013 +0200

    vdsm 4.13.0-14

 ...filters-on-HSMs-before-rescanning-extende.patch |   67 ++++++++
 ...vm-refresh-raw-disk-before-live-extension.patch |   41 +++++
 ...c-sysctl.d-vdsm-to-etc-sysctl.d-vdsm.conf.patch |   81 +++++++++
 0004-vm-unify-_highWrite-and-_onAbnormalStop.patch |  109 +++++++++++++
 0005-vm-prevent-faulty-volume-extensions.patch     |   79 +++++++++
 ...s-coarse-grain-libvirt.rpm-may-be-missing.patch |   73 +++++++++
 0007-Report-qemu-kvm-rhev-if-installed.patch       |   35 ++++
 ...llow-multiple-LVs-to-be-refreshed-at-once.patch |   63 +++++++
 0009-lvm-Deactivate-lvs-during-bootstrap.patch     |  115 +++++++++++++
 ...Fix-indentation-to-comply-with-pep8-1.3.3.patch |   40 +++++
 ...ated-services-restart-after-reconfiguring.patch |  118 ++++++++++++++
 ...ccents-in-the-vm-name-break-the-migration.patch |   36 ++++
 ...ellation-of-migrations-gets-handled-corre.patch |   93 +++++++++++
 ...luster-modules-when-with_gluster-set-to-0.patch |  104 ++++++++++++
 ...cancellation-replies-wrong-message-format.patch |   47 ++++++
 ...info-fix-linkShowDev-parsing-in-getVlanID.patch |   66 ++++++++
 0017-fuserTests-fix-for-f20-and-arch.patch         |   45 +++++
 0018-Adding-debian-folder-makefile.patch           |  150 +++++++++++++++++
 0019-Fix-Makefile.am-in-debian-folder.patch        |  172 ++++++++++++++++++++
 ...Disable-exception-on-after-hooks-failures.patch |   79 +++++++++
 0021-vm-Fix-vm-unpausing-during-recovery.patch     |  119 ++++++++++++++
 0022-Revert-fix-premature-selinux-dependency.patch |   45 +++++
 ...vdsm.spec-conditional-to-execute-semanage.patch |   37 +++++
 ...dsm.spec-conditional-for-hostname-require.patch |  124 ++++++++++++++
 vdsm.spec                                          |   94 ++++++++----
 25 files changed, 2004 insertions(+), 28 deletions(-)
---
diff --git a/0001-Invalidate-filters-on-HSMs-before-rescanning-extende.patch b/0001-Invalidate-filters-on-HSMs-before-rescanning-extende.patch
new file mode 100644
index 0000000..8127536
--- /dev/null
+++ b/0001-Invalidate-filters-on-HSMs-before-rescanning-extende.patch
@@ -0,0 +1,67 @@
+From d6589211bbe9b9b8975faecd6b04ea297bfeea4f Mon Sep 17 00:00:00 2001
+From: Pavel Zhukov <pzhukov at redhat.com>
+Date: Fri, 25 Oct 2013 11:10:39 +0200
+Subject: [PATCH 01/21] Invalidate filters  on HSMs before rescanning extended
+ VG
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+domainMonitor thread might use stale lvm filters while running vgs
+command after extending of the VG (added PV is missed in the filter
+set). Since LvmCache doesn't invalidate filters, the volume
+group  is marked as partial and domainMonitor selftest fails
+(host goes to non-operational status). By design filter should be
+invalidated if cmd returns nonzero code but vgs returns zero even if
+devices are filtered . The patch introduces public  method for
+filter invalidation and calls it from the getDevicesVisibility
+because getDevicesVisibility is called on all DC hosts after
+adding new device but before extendSD.
+
+Change-Id: If1eeed1c203f2c8c73370987048565d665932299
+Bugzilla-Url: https://bugzilla.redhat.com/1022976
+Signed-off-by: Pavel Zhukov <pzhukov at redhat.com>
+Signed-off-by: Sergey Gotliv <sgotliv at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/20552
+Reviewed-by: Tomáš Došek <tdosek at redhat.com>
+Reviewed-by: Sergey Gotliv <sgotliv at redhat.com>
+Reviewed-by: Ayal Baron <abaron at redhat.com>
+Reviewed-by: Nir Soffer <nsoffer at redhat.com>
+Reviewed-by: Federico Simoncelli <fsimonce at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21223
+Reviewed-by: Allon Mureinik <amureini at redhat.com>
+---
+ vdsm/storage/hsm.py | 1 +
+ vdsm/storage/lvm.py | 4 ++++
+ 2 files changed, 5 insertions(+)
+
+diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
+index 1307699..3e0c022 100644
+--- a/vdsm/storage/hsm.py
++++ b/vdsm/storage/hsm.py
+@@ -1996,6 +1996,7 @@ class HSM:
+         :rtype: dict
+         """
+         visibility = self.scanDevicesVisibility(guids)
++        lvm.invalidateFilter()
+         for guid in guids:
+             if visibility[guid]:
+                 visibility[guid] = (os.stat('/dev/mapper/' + guid).st_mode &
+diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
+index 065e1ea..7f87362 100644
+--- a/vdsm/storage/lvm.py
++++ b/vdsm/storage/lvm.py
+@@ -1313,6 +1313,10 @@ def lvsByTag(vgName, tag):
+     return [lv for lv in getLV(vgName) if tag in lv.tags]
+ 
+ 
++def invalidateFilter():
++    _lvminfo.invalidateFilter()
++
++
+ # Fix me: unify with addTag
+ def replaceLVTag(vg, lv, deltag, addtag):
+     """
+-- 
+1.8.4.2
+
diff --git a/0002-vm-refresh-raw-disk-before-live-extension.patch b/0002-vm-refresh-raw-disk-before-live-extension.patch
new file mode 100644
index 0000000..bac974f
--- /dev/null
+++ b/0002-vm-refresh-raw-disk-before-live-extension.patch
@@ -0,0 +1,41 @@
+From 97eeb3f814659ff81bed6b9e5817b6fffa9825a8 Mon Sep 17 00:00:00 2001
+From: Federico Simoncelli <fsimonce at redhat.com>
+Date: Tue, 12 Nov 2013 09:02:08 -0500
+Subject: [PATCH 02/21] vm: refresh raw disk before live extension
+
+As part of the online disk extension (raw format on block domains) flow
+the leaf logical volume is extended by the SPM to the new size.
+On the HSM host (where the VM is running) we need to refresh the volume
+in order to update the volume segments and make the new size visible to
+the qemu process.
+
+Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1029501
+Change-Id: I4fc3b578a865e25586a719f7c5120df12842d046
+Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21177
+Reviewed-by: Ayal Baron <abaron at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21274
+---
+ vdsm/vm.py | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/vdsm/vm.py b/vdsm/vm.py
+index 1a16d53..475f6ce 100644
+--- a/vdsm/vm.py
++++ b/vdsm/vm.py
+@@ -4054,6 +4054,12 @@ class Vm(object):
+         return {'status': doneCode, 'size': str(sizeRoundedBytes)}
+ 
+     def _diskSizeExtendRaw(self, drive, newSizeBytes):
++        # Picking up the volume size extension
++        self.__refreshDriveVolume({
++            'domainID': drive.domainID, 'poolID': drive.poolID,
++            'imageID': drive.imageID, 'volumeID': drive.volumeID,
++        })
++
+         volumeInfo = self.cif.irs.getVolumeSize(
+             drive.domainID, drive.poolID, drive.imageID, drive.volumeID)
+ 
+-- 
+1.8.4.2
+
diff --git a/0003-Renaming-etc-sysctl.d-vdsm-to-etc-sysctl.d-vdsm.conf.patch b/0003-Renaming-etc-sysctl.d-vdsm-to-etc-sysctl.d-vdsm.conf.patch
new file mode 100644
index 0000000..54e8170
--- /dev/null
+++ b/0003-Renaming-etc-sysctl.d-vdsm-to-etc-sysctl.d-vdsm.conf.patch
@@ -0,0 +1,81 @@
+From 03008aac61d426777bd2fc34ba7f9e3f2032a95b Mon Sep 17 00:00:00 2001
+From: Sandro Bonazzola <sbonazzo at redhat.com>
+Date: Tue, 12 Nov 2013 11:14:24 +0100
+Subject: [PATCH 03/21] Renaming /etc/sysctl.d/vdsm to /etc/sysctl.d/vdsm.conf
+
+Fixing Bug #740887 it has been added the file /etc/sysctl.d/vdsm which
+works fine on RHEL and CentOS but it's not read on Fedora because
+it should be /etc/sysctl.d/vdsm.conf ( see sysctl --system output )
+
+Change-Id: I4ac929db854d7a5f9bd96d144e8ef36070f74126
+Bug-Url: https://bugzilla.redhat.com/1029368
+Signed-off-by: Sandro Bonazzola <sbonazzo at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21160
+Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21202
+Reviewed-by: Antoni Segura Puimedon <asegurap at redhat.com>
+Reviewed-by: Douglas Schilling Landgraf <dougsland at redhat.com>
+---
+ debian/vdsm.install          | 2 +-
+ debian/vdsm.postinst         | 2 +-
+ init/vdsmd_init_common.sh.in | 2 +-
+ vdsm.spec.in                 | 4 ++--
+ vdsm/Makefile.am             | 4 ++--
+ 5 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/init/vdsmd_init_common.sh.in b/init/vdsmd_init_common.sh.in
+index 38da542..89c60e9 100644
+--- a/init/vdsmd_init_common.sh.in
++++ b/init/vdsmd_init_common.sh.in
+@@ -93,7 +93,7 @@ task_load_needed_modules(){
+ 
+ 
+ task_tune_system(){
+-    "@SYSCTL_PATH@" -q -p "/etc/sysctl.d/vdsm"
++    "@SYSCTL_PATH@" -q -p "/etc/sysctl.d/vdsm.conf"
+ }
+ 
+ 
+diff --git a/vdsm.spec.in b/vdsm.spec.in
+index eae38fa..5e306e4 100644
+--- a/vdsm.spec.in
++++ b/vdsm.spec.in
+@@ -641,7 +641,7 @@ export LC_ALL=C
+ # set the vdsm "secret" password for libvirt
+ %{_bindir}/vdsm-tool set-saslpasswd
+ 
+-# Have moved vdsm section in /etc/sysctl.conf to /etc/sysctl.d/vdsm.
++# Have moved vdsm section in /etc/sysctl.conf to /etc/sysctl.d/vdsm.conf.
+ # So Remove them if it is played with /etc/sysctl.conf.
+ if grep -q "# VDSM section begin" /etc/sysctl.conf; then
+     /bin/sed -i '/# VDSM section begin/,/# VDSM section end/d' \
+@@ -864,7 +864,7 @@ exit 0
+ %config(noreplace) %{_sysconfdir}/%{vdsm_name}/mom.d/*.policy
+ %config(noreplace) %{_sysconfdir}/logrotate.d/vdsm
+ %config(noreplace) %{_sysconfdir}/rwtab.d/vdsm
+-%config(noreplace) %{_sysconfdir}/sysctl.d/vdsm
++%config(noreplace) %{_sysconfdir}/sysctl.d/vdsm.conf
+ %if 0%{?with_systemd}
+ %config(noreplace) %{_sysconfdir}/modules-load.d/vdsm.conf
+ %endif
+diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
+index 305ef6b..26be4dc 100644
+--- a/vdsm/Makefile.am
++++ b/vdsm/Makefile.am
+@@ -239,10 +239,10 @@ uninstall-data-sudoers:
+ install-data-sysctl:
+ 	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysctl.d
+ 	$(INSTALL_DATA) $(srcdir)/vdsm-sysctl.conf \
+-		$(DESTDIR)$(sysconfdir)/sysctl.d/vdsm
++		$(DESTDIR)$(sysconfdir)/sysctl.d/vdsm.conf
+ 
+ uninstall-data-sysctl:
+-	$(RM) $(DESTDIR)$(sysconfdir)/sysctl.d/vdsm
++	$(RM) $(DESTDIR)$(sysconfdir)/sysctl.d/vdsm.conf
+ 
+ install-data-dhclient-hooks:
+ 	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/dhcp/dhclient.d
+-- 
+1.8.4.2
+
diff --git a/0004-vm-unify-_highWrite-and-_onAbnormalStop.patch b/0004-vm-unify-_highWrite-and-_onAbnormalStop.patch
new file mode 100644
index 0000000..3346a4b
--- /dev/null
+++ b/0004-vm-unify-_highWrite-and-_onAbnormalStop.patch
@@ -0,0 +1,109 @@
+From 8a34b1055736aa677ce5fcd88f0086c0df6c599c Mon Sep 17 00:00:00 2001
+From: Federico Simoncelli <fsimonce at redhat.com>
+Date: Wed, 6 Nov 2013 08:50:57 -0500
+Subject: [PATCH 04/21] vm: unify _highWrite and _onAbnormalStop
+
+Both _highWrite and _onAbnormalStop should share the same logic about
+the volume extension.
+
+Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=998443
+Change-Id: I4fd790986b81402847b06810529841cfd7bae119
+Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/20966
+Reviewed-by: Sergey Gotliv <sgotliv at redhat.com>
+Reviewed-by: Ayal Baron <abaron at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21382
+Tested-by: Allon Mureinik <amureini at redhat.com>
+Reviewed-by: Allon Mureinik <amureini at redhat.com>
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+---
+ vdsm/vm.py | 59 ++++++++++++++++++++++++-----------------------------------
+ 1 file changed, 24 insertions(+), 35 deletions(-)
+
+diff --git a/vdsm/vm.py b/vdsm/vm.py
+index 475f6ce..2bf9a1e 100644
+--- a/vdsm/vm.py
++++ b/vdsm/vm.py
+@@ -504,22 +504,7 @@ class VmStatsThread(sampling.AdvancedStatsThread):
+         if not self._vm.isDisksStatsCollectionEnabled():
+             # Avoid queries from storage during recovery process
+             return
+-
+-        for vmDrive in self._vm._devices[DISK_DEVICES]:
+-            if not vmDrive.blockDev or vmDrive.format != 'cow':
+-                continue
+-
+-            capacity, alloc, physical = \
+-                self._vm._dom.blockInfo(vmDrive.path, 0)
+-
+-            if physical - alloc >= vmDrive.watermarkLimit:
+-                continue
+-
+-            self._log.info('%s/%s apparent: %s capacity: %s, alloc: %s, '
+-                           'phys: %s', vmDrive.domainID, vmDrive.volumeID,
+-                           vmDrive.apparentsize, capacity, alloc, physical)
+-
+-            self._vm.extendDriveVolume(vmDrive)
++        self._vm.extendDrivesIfNeeded()
+ 
+     def _updateVolumes(self):
+         if not self._vm.isDisksStatsCollectionEnabled():
+@@ -2272,6 +2257,27 @@ class Vm(object):
+         with self._confLock:
+             self.conf['timeOffset'] = timeOffset
+ 
++    def extendDrivesIfNeeded(self):
++        extend = []
++
++        for drive in self._devices[DISK_DEVICES]:
++            if not drive.blockDev or drive.format != 'cow':
++                continue
++
++            capacity, alloc, physical = self._dom.blockInfo(drive.path, 0)
++            if physical - alloc < drive.watermarkLimit:
++                extend.append((drive, capacity, alloc, physical))
++
++        for drive, capacity, alloc, physical in extend:
++            self.log.info(
++                "Requesting extension for volume %s on domain %s (apparent: "
++                "%s, capacity: %s, allocated: %s, physical: %s)",
++                drive.volumeID, drive.domainID, drive.apparentsize, capacity,
++                alloc, physical)
++            self.extendDriveVolume(drive)
++
++        return len(extend) > 0
++
+     def extendDriveVolume(self, vmDrive):
+         if not vmDrive.blockDev:
+             return
+@@ -4208,25 +4214,8 @@ class Vm(object):
+         self.conf['pauseCode'] = err.upper()
+         self._guestCpuRunning = False
+         if err.upper() == 'ENOSPC':
+-            for d in self._devices[DISK_DEVICES]:
+-                if d.alias == blockDevAlias:
+-                    #in the case of a qcow2-like file stored inside a block
+-                    #device 'physical' will give the block device size, while
+-                    #'allocation' will give the qcow2 image size
+-                    #D. Berrange
+-                    capacity, alloc, physical = self._dom.blockInfo(d.path, 0)
+-                    if (physical >
+-                        (alloc + config.getint(
+-                            'irs', 'volume_utilization_chunk_mb'))):
+-                        self.log.warn('%s = %s/%s error %s phys: %s alloc: %s '
+-                                      'Ingnoring already managed event.',
+-                                      blockDevAlias, d.domainID, d.volumeID,
+-                                      err, physical, alloc)
+-                        return
+-                    self.log.info('%s = %s/%s error %s phys: %s alloc: %s',
+-                                  blockDevAlias, d.domainID, d.volumeID, err,
+-                                  physical, alloc)
+-                    self.extendDriveVolume(d)
++            if not self.extendDrivesIfNeeded():
++                self.log.info("No VM drives were extended")
+ 
+     def _acpiShutdown(self):
+         self._dom.shutdownFlags(libvirt.VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN)
+-- 
+1.8.4.2
+
diff --git a/0005-vm-prevent-faulty-volume-extensions.patch b/0005-vm-prevent-faulty-volume-extensions.patch
new file mode 100644
index 0000000..a1f4d20
--- /dev/null
+++ b/0005-vm-prevent-faulty-volume-extensions.patch
@@ -0,0 +1,79 @@
+From 7a5649330298880c9ac2cd80815b0d06dac738df Mon Sep 17 00:00:00 2001
+From: Federico Simoncelli <fsimonce at redhat.com>
+Date: Mon, 11 Nov 2013 09:05:05 -0500
+Subject: [PATCH 05/21] vm: prevent faulty volume extensions
+
+Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=998443
+Change-Id: If7e85c50f375ed7ed0297330b8cd83e38e0986c7
+Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
+Signed-off-by: Yeela Kaplan <ykaplan at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21150
+Reviewed-by: Sergey Gotliv <sgotliv at redhat.com>
+Reviewed-by: Ayal Baron <abaron at redhat.com>
+Reviewed-by: Allon Mureinik <amureini at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21383
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+---
+ vdsm/vm.py | 35 +++++++++++++++++++++++++++++++++--
+ 1 file changed, 33 insertions(+), 2 deletions(-)
+
+diff --git a/vdsm/vm.py b/vdsm/vm.py
+index 2bf9a1e..0921fb2 100644
+--- a/vdsm/vm.py
++++ b/vdsm/vm.py
+@@ -2265,6 +2265,36 @@ class Vm(object):
+                 continue
+ 
+             capacity, alloc, physical = self._dom.blockInfo(drive.path, 0)
++
++            # Since the check based on nextPhysSize is extremly risky (it
++            # may result in the VM being paused) we can't use the regular
++            # getNextVolumeSize call as it relies on a cached value of the
++            # drive apparentsize.
++            nextPhysSize = physical + drive.VOLWM_CHUNK_MB * constants.MEGAB
++
++            # NOTE: the intent of this check is to prevent faulty images to
++            # trick qemu in requesting extremely large extensions (BZ#998443).
++            # Probably the definitive check would be comparing the allocated
++            # space with capacity + format_overhead. Anyway given that:
++            #
++            # - format_overhead is tricky to be computed (it depends on few
++            #   assumptions that may change in the future e.g. cluster size)
++            # - currently we allow only to extend by one chunk at time
++            #
++            # the current check compares alloc with the next volume size.
++            # It should be noted that alloc cannot be directly compared with
++            # the volume physical size as it includes also the clusters not
++            # written yet (pending).
++            if alloc > nextPhysSize:
++                self.log.error(
++                    "Improbable extension request for volume %s on domain "
++                    "%s, pausing the VM to avoid corruptions (capacity: %s, "
++                    "allocated: %s, physical: %s, next physical size: %s)",
++                    drive.volumeID, drive.domainID, capacity, alloc,
++                    physical, nextPhysSize)
++                self.pause(pauseCode='EOTHER')
++                return False
++
+             if physical - alloc < drive.watermarkLimit:
+                 extend.append((drive, capacity, alloc, physical))
+ 
+@@ -2415,12 +2445,13 @@ class Vm(object):
+             if not guestCpuLocked:
+                 self._guestCpuLock.release()
+ 
+-    def pause(self, afterState='Paused', guestCpuLocked=False):
++    def pause(self, afterState='Paused', guestCpuLocked=False,
++              pauseCode='NOERR'):
+         if not guestCpuLocked:
+             self._acquireCpuLockWithTimeout()
+         try:
+             with self._confLock:
+-                self.conf['pauseCode'] = 'NOERR'
++                self.conf['pauseCode'] = pauseCode
+             self._underlyingPause()
+             if hasattr(self, 'updateGuestCpuRunning'):
+                 self.updateGuestCpuRunning()
+-- 
+1.8.4.2
+
diff --git a/0006-caps-coarse-grain-libvirt.rpm-may-be-missing.patch b/0006-caps-coarse-grain-libvirt.rpm-may-be-missing.patch
new file mode 100644
index 0000000..7ebdfd5
--- /dev/null
+++ b/0006-caps-coarse-grain-libvirt.rpm-may-be-missing.patch
@@ -0,0 +1,73 @@
+From 9792e7e2ec67bf29bcd2083125792d55f5bfab28 Mon Sep 17 00:00:00 2001
+From: Dan Kenigsberg <danken at redhat.com>
+Date: Mon, 16 Sep 2013 16:02:46 +0100
+Subject: [PATCH 06/21] caps: coarse-grain libvirt.rpm may be missing
+
+As of http://gerrit.ovirt.org/15761 we no longer require the legacy
+libvirt.rpm to be installed on Fedora, so getCaps should not look for
+it. Instead, it should report the information of the installed
+libvirt-daemon-kvm.rpm.
+
+Without this patch we get an annoying
+    (_getKeyPackages) rpm package libvirt not found
+log message, and do not report libvirt's version.
+
+Change-Id: I733a1a2411c910caa030e435c2a7f751a8e4dad4
+Signed-off-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/19295
+Reviewed-by: mooli tayer <mtayer at redhat.com>
+Reviewed-by: Douglas Schilling Landgraf <dougsland at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21363
+Tested-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
+---
+ vdsm/caps.py | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/vdsm/caps.py b/vdsm/caps.py
+index 3a7a6a2..c5ecadc 100644
+--- a/vdsm/caps.py
++++ b/vdsm/caps.py
+@@ -20,6 +20,7 @@
+ 
+ """Collect host capabilities"""
+ 
++import itertools
+ import os
+ from xml.dom import minidom
+ import logging
+@@ -323,12 +324,12 @@ def _getKeyPackages():
+     pkgs = {'kernel': kernelDict()}
+ 
+     if getos() in (OSName.RHEVH, OSName.OVIRT, OSName.FEDORA, OSName.RHEL):
+-        KEY_PACKAGES = {'qemu-kvm': 'qemu-kvm',
+-                        'qemu-img': 'qemu-img',
+-                        'vdsm': 'vdsm',
+-                        'spice-server': 'spice-server',
+-                        'libvirt': 'libvirt',
+-                        'mom': 'mom',
++        KEY_PACKAGES = {'qemu-kvm': ('qemu-kvm',),
++                        'qemu-img': ('qemu-img',),
++                        'vdsm': ('vdsm',),
++                        'spice-server': ('spice-server',),
++                        'libvirt': ('libvirt', 'libvirt-daemon-kvm'),
++                        'mom': ('mom',),
+                         }
+ 
+         if _glusterEnabled:
+@@ -337,9 +338,10 @@ def _getKeyPackages():
+         try:
+             ts = rpm.TransactionSet()
+ 
+-            for pkg in KEY_PACKAGES:
++            for pkg, names in KEY_PACKAGES.iteritems():
+                 try:
+-                    mi = ts.dbMatch('name', KEY_PACKAGES[pkg]).next()
++                    mi = itertools.chain(*[ts.dbMatch('name', name)
++                                           for name in names]).next()
+                 except StopIteration:
+                     logging.debug("rpm package %s not found",
+                                   KEY_PACKAGES[pkg])
+-- 
+1.8.4.2
+
diff --git a/0007-Report-qemu-kvm-rhev-if-installed.patch b/0007-Report-qemu-kvm-rhev-if-installed.patch
new file mode 100644
index 0000000..3ac4763
--- /dev/null
+++ b/0007-Report-qemu-kvm-rhev-if-installed.patch
@@ -0,0 +1,35 @@
+From 0150a6ed14787830527adcc5e137e2402569331f Mon Sep 17 00:00:00 2001
+From: Dan Kenigsberg <danken at redhat.com>
+Date: Wed, 13 Nov 2013 13:18:43 +0000
+Subject: [PATCH 07/21] Report qemu-kvm-rhev if installed
+
+Change-Id: If6b59241bbf38b6cd15fd941e1f68115853d22c1
+Bug-Url: https://bugzilla.redhat.com/1029792
+Signed-off-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21226
+Reviewed-by: Douglas Schilling Landgraf <dougsland at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21364
+Tested-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
+---
+ vdsm/caps.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/vdsm/caps.py b/vdsm/caps.py
+index c5ecadc..a6e22d2 100644
+--- a/vdsm/caps.py
++++ b/vdsm/caps.py
+@@ -324,8 +324,8 @@ def _getKeyPackages():
+     pkgs = {'kernel': kernelDict()}
+ 
+     if getos() in (OSName.RHEVH, OSName.OVIRT, OSName.FEDORA, OSName.RHEL):
+-        KEY_PACKAGES = {'qemu-kvm': ('qemu-kvm',),
+-                        'qemu-img': ('qemu-img',),
++        KEY_PACKAGES = {'qemu-kvm': ('qemu-kvm', 'qemu-kvm-rhev'),
++                        'qemu-img': ('qemu-img', 'qemu-img-rhev'),
+                         'vdsm': ('vdsm',),
+                         'spice-server': ('spice-server',),
+                         'libvirt': ('libvirt', 'libvirt-daemon-kvm'),
+-- 
+1.8.4.2
+
diff --git a/0008-lvm-Allow-multiple-LVs-to-be-refreshed-at-once.patch b/0008-lvm-Allow-multiple-LVs-to-be-refreshed-at-once.patch
new file mode 100644
index 0000000..14d7ef3
--- /dev/null
+++ b/0008-lvm-Allow-multiple-LVs-to-be-refreshed-at-once.patch
@@ -0,0 +1,63 @@
+From e789aec721baf6f77a9ac304375d0e170cf63358 Mon Sep 17 00:00:00 2001
+From: Lee Yarwood <lyarwood at redhat.com>
+Date: Mon, 18 Nov 2013 16:30:51 +0000
+Subject: [PATCH 08/21] lvm: Allow multiple LVs to be refreshed at once
+
+lvm.refreshLV() function used to accept only single lv, requiring
+multiple invocations for refreshing multiple lvs, although lvm allows
+refreshing of multiple lvs. This patch rename the function and accept
+multiple lvs and invoke lvchange once with given lvs.
+
+This change is required for patch http://gerrit.ovirt.org/#/c/21501.
+
+Change-Id: I1ecc64b8ca0133b030ba5bfa37f1a2c55067dd5d
+Bug-Url: https://bugzilla.redhat.com/1009812
+Signed-off-by: Lee Yarwood <lyarwood at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/19871
+Reviewed-by: Nir Soffer <nsoffer at redhat.com>
+Reviewed-by: Allon Mureinik <amureini at redhat.com>
+Tested-by: Nir Soffer <nsoffer at redhat.com>
+Reviewed-by: Federico Simoncelli <fsimonce at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21500
+---
+ vdsm/storage/blockVolume.py | 2 +-
+ vdsm/storage/lvm.py         | 9 +++++----
+ 2 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/vdsm/storage/blockVolume.py b/vdsm/storage/blockVolume.py
+index badf2c1..958a04d 100644
+--- a/vdsm/storage/blockVolume.py
++++ b/vdsm/storage/blockVolume.py
+@@ -95,7 +95,7 @@ class BlockVolume(volume.Volume):
+         volume.Volume.validate(self)
+ 
+     def refreshVolume(self):
+-        lvm.refreshLV(self.sdUUID, self.volUUID)
++        lvm.refreshLVs(self.sdUUID, (self.volUUID,))
+ 
+     @classmethod
+     def getVSize(cls, sdobj, imgUUID, volUUID, bs=BLOCK_SIZE):
+diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
+index 7f87362..b195343 100644
+--- a/vdsm/storage/lvm.py
++++ b/vdsm/storage/lvm.py
+@@ -1150,11 +1150,12 @@ def renameLV(vg, oldlv, newlv):
+     _lvminfo._reloadlvs(vg, newlv)
+ 
+ 
+-def refreshLV(vgName, lvName):
+-    # If  the  logical  volume  is active, reload its metadata.
+-    cmd = ['lvchange', '--refresh', "%s/%s" % (vgName, lvName)]
++def refreshLVs(vgName, lvNames):
++    # If  the  logical  volumes  are active, reload their metadata.
++    cmd = ['lvchange', '--refresh']
++    cmd.extend("%s/%s" % (vgName, lv) for lv in lvNames)
+     rc, out, err = _lvminfo.cmd(cmd, _lvminfo._getVGDevs((vgName, )))
+-    _lvminfo._invalidatelvs(vgName, lvName)
++    _lvminfo._invalidatelvs(vgName, lvNames)
+     if rc != 0:
+         raise se.LogicalVolumeRefreshError("%s failed" % list2cmdline(cmd))
+ 
+-- 
+1.8.4.2
+
diff --git a/0009-lvm-Deactivate-lvs-during-bootstrap.patch b/0009-lvm-Deactivate-lvs-during-bootstrap.patch
new file mode 100644
index 0000000..0e1eb1e
--- /dev/null
+++ b/0009-lvm-Deactivate-lvs-during-bootstrap.patch
@@ -0,0 +1,115 @@
+From 08650fe0d462f4d877792c020e26b2fd19c1ccf4 Mon Sep 17 00:00:00 2001
+From: Nir Soffer <nsoffer at redhat.com>
+Date: Fri, 15 Nov 2013 01:19:32 +0200
+Subject: [PATCH 09/21] lvm: Deactivate lvs during bootstrap
+
+When using FC storage, physical volumes are connected during boot, and vdsm
+logical volumes are auto-activated by both /etc/rc.sysinit and
+/etc/init.d/netfs startup scripts. These logical volumes do not pick changes
+done by the SPM on the storage, which may lead to data corruption sooner or
+later, when a vm is trying to write to logical volume with stale meta data.
+
+This patch check all vdsm logical volumes during lvm bootstrap and
+deactivate them if possible. Special logical volumes are refreshed,
+since they are accessed early when connecting to storage pool, possibly
+before lvm bootstrap is done. Open logical volumes are skipped because
+we assume that they use correct meta data when opened.
+
+To fix the auto-activation during boot, we could perform this only on
+the first start of the service and limit the operation to FC storage.
+However, we decided to use this on all block storage types, and on every
+start of the service, as additional layer of protection from logical
+volumes left active after unclean shutdown of the service, or other
+failures to deactivate logical volumes.
+
+Deactivation adds up to two lvchange calls for each volume group with
+active logical volumes. After the first service start, logical volumes
+are typically inactive and this change adds minimal additional cost,
+refreshing active special logical volumes.
+
+Depends on http://gerrit.ovirt.org/#/c/21500/ for refreshing multiple
+logical volumes in one call.
+
+Change-Id: I5f142ebca7a00d45f2500ad2631fab2366f2f7db
+Bug-Url: https://bugzilla.redhat.com/1009812
+Signed-off-by: Nir Soffer <nsoffer at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21291
+Reviewed-by: Federico Simoncelli <fsimonce at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21501
+Reviewed-by: Allon Mureinik <amureini at redhat.com>
+---
+ vdsm/storage/hsm.py |  2 +-
+ vdsm/storage/lvm.py | 44 ++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 45 insertions(+), 1 deletion(-)
+
+diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
+index 3e0c022..d4c5dfc 100644
+--- a/vdsm/storage/hsm.py
++++ b/vdsm/storage/hsm.py
+@@ -371,7 +371,7 @@ class HSM:
+             self.log.warn("Failed to clean Storage Repository.", exc_info=True)
+ 
+         def storageRefresh():
+-            lvm._lvminfo.bootstrap()
++            lvm.bootstrap(refreshlvs=blockSD.SPECIAL_LVS)
+             sdCache.refreshStorage()
+ 
+             fileUtils.createdir(self.tasksDir)
+diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
+index b195343..52bb8b3 100644
+--- a/vdsm/storage/lvm.py
++++ b/vdsm/storage/lvm.py
+@@ -650,6 +650,50 @@ class LVMCache(object):
+ _lvminfo = LVMCache()
+ 
+ 
++def bootstrap(refreshlvs=()):
++    """
++    Bootstrap lvm module
++
++    This function builds the lvm cache and ensure that all unused lvs are
++    deactivated, expect lvs matching refreshlvs, which are refreshed instead.
++    """
++    _lvminfo.bootstrap()
++
++    refreshlvs = set(refreshlvs)
++
++    for vg in _lvminfo.getAllVgs():
++        deactivate = []
++        refresh = []
++
++        for lv in _lvminfo.getLv(vg.name):
++            if lv.active:
++                if lv.name in refreshlvs:
++                    refresh.append(lv.name)
++                elif lv.opened:
++                    log.debug("Skipping open lv: vg=%s lv=%s", vg.name,
++                              lv.name)
++                else:
++                    deactivate.append(lv.name)
++
++        if deactivate:
++            log.info("Deactivating lvs: vg=%s lvs=%s", vg.name, deactivate)
++            try:
++                _setLVAvailability(vg.name, deactivate, "n")
++            except se.CannotDeactivateLogicalVolume:
++                log.error("Error deactivating lvs: vg=%s lvs=%s", vg.name,
++                          deactivate)
++            # Some lvs are inactive now
++            _lvminfo._invalidatelvs(vg.name, deactivate)
++
++        if refresh:
++            log.info("Refreshing lvs: vg=%s lvs=%s", vg.name, refresh)
++            try:
++                refreshLVs(vg.name, refresh)
++            except se.LogicalVolumeRefreshError:
++                log.error("Error refreshing lvs: vg=%s lvs=%s", vg.name,
++                          refresh)
++
++
+ def invalidateCache():
+     _lvminfo.invalidateCache()
+ 
+-- 
+1.8.4.2
+
diff --git a/0010-pep8-Fix-indentation-to-comply-with-pep8-1.3.3.patch b/0010-pep8-Fix-indentation-to-comply-with-pep8-1.3.3.patch
new file mode 100644
index 0000000..948f77f
--- /dev/null
+++ b/0010-pep8-Fix-indentation-to-comply-with-pep8-1.3.3.patch
@@ -0,0 +1,40 @@
+From 1114579a64370cdda1b554e90718c1fba90195fd Mon Sep 17 00:00:00 2001
+From: Nir Soffer <nsoffer at redhat.com>
+Date: Thu, 7 Nov 2013 20:37:14 +0200
+Subject: [PATCH 10/21] pep8: Fix indentation to comply with pep8 1.3.3
+
+Commit 2c9f0d66db7795 introduced a pep8 indentation regression, breaking
+the build on RHEL using vdsm provided pep8. This patch fixes the
+indentation by breaking long statement to multiple lines.
+
+Change-Id: I3431742f9dbfd86a9816c7b3c6de90e282dbd415
+Relates-To: https://bugzilla.redhat.com/1022975
+Signed-off-by: Nir Soffer <nsoffer at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21055
+Reviewed-by: Antoni Segura Puimedon <asegurap at redhat.com>
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21196
+Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Tested-by: Yaniv Bronhaim <ybronhei at redhat.com>
+---
+ vdsm/storage/imageRepository/formatConverter.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/vdsm/storage/imageRepository/formatConverter.py b/vdsm/storage/imageRepository/formatConverter.py
+index 441f484..c701163 100644
+--- a/vdsm/storage/imageRepository/formatConverter.py
++++ b/vdsm/storage/imageRepository/formatConverter.py
+@@ -276,8 +276,8 @@ def v3DomainConverter(repoPath, hostId, domain, isMsd):
+ 
+                 for volUUID in imgVolumes:
+                     try:
+-                        v3ResetMetaVolSize(  # BZ#811880
+-                            domain.produceVolume(imgUUID, volUUID))
++                        vol = domain.produceVolume(imgUUID, volUUID)
++                        v3ResetMetaVolSize(vol)  # BZ#811880
+                     except qemuImg.QImgError:
+                         log.error("It is not possible to read the volume %s "
+                                   "using qemu-img, the content looks damaged",
+-- 
+1.8.4.2
+
diff --git a/0011-Peform-related-services-restart-after-reconfiguring.patch b/0011-Peform-related-services-restart-after-reconfiguring.patch
new file mode 100644
index 0000000..2fed013
--- /dev/null
+++ b/0011-Peform-related-services-restart-after-reconfiguring.patch
@@ -0,0 +1,118 @@
+From e686703f15ca86973d36174e33c18adc9bc3b4e1 Mon Sep 17 00:00:00 2001
+From: Yaniv Bronhaim <ybronhei at redhat.com>
+Date: Sun, 24 Nov 2013 14:08:15 +0200
+Subject: [PATCH 11/21] Peform related services restart after reconfiguring
+
+Although we tried to avoid doing restart to external services as part of
+the pre-start of vdsm, the full implementation of vdsm-tool API that allows to
+check isconfigured before performing the configuration itself is missing in
+ovirt-3.3.
+
+Currently when running libvirt-configure we return 0 (SUCCESS) on both
+reconfigure and if libvirt conf is already configured with vdsm details.
+That's lead to a problem to decide when to stop the pre-start part and wait
+for manual restart, or continue as it is already working with the right
+configurations.
+
+To avoid more changes, we return the auto restart to allow easy start of
+vdsm without more specific tweaks.
+
+Change-Id: I8216f9556e6ef4df96977db494c5b5169bfae80a
+Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1031592
+Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21356
+Reviewed-by: Alon Bar-Lev <alonbl at redhat.com>
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+---
+ README                                | 4 +---
+ init/systemd/systemd-vdsmd.in         | 3 +--
+ init/sysvinit/vdsmd.init.in           | 3 +--
+ lib/vdsm/tool/libvirt_configure.sh.in | 9 ++-------
+ vdsm.spec.in                          | 7 +++----
+ 5 files changed, 8 insertions(+), 18 deletions(-)
+
+diff --git a/README b/README
+index 7ddce56..e3f70ef 100644
+--- a/README
++++ b/README
+@@ -25,11 +25,9 @@ start you can do
+    make
+    sudo make install
+ 
+-Before starting the VDSM service in the first time, you must configure and
+-restart libvirt service:
++Before starting the VDSM service in the first time, you must configure libvirt
+ 
+    vdsm-tool libvirt-configure
+-   vdsm-tool libvirt-configure-services-restart
+ 
+ Packaging
+ =========
+diff --git a/init/systemd/systemd-vdsmd.in b/init/systemd/systemd-vdsmd.in
+index 692e5eb..cf20b84 100644
+--- a/init/systemd/systemd-vdsmd.in
++++ b/init/systemd/systemd-vdsmd.in
+@@ -26,5 +26,4 @@ usage_exit(){
+ [ "$1" != "reconfigure" ] && usage_exit
+ [ -n "$2" -a "$2" != "force" ] && usage_exit
+ 
+-"@BINDIR@/vdsm-tool" libvirt-configure ${2:+--force} &&
+-    "@BINDIR@/vdsm-tool" libvirt-configure-services-restart
++"@BINDIR@/vdsm-tool" libvirt-configure ${2:+--force}
+diff --git a/init/sysvinit/vdsmd.init.in b/init/sysvinit/vdsmd.init.in
+index efd9c35..dc7847e 100755
+--- a/init/sysvinit/vdsmd.init.in
++++ b/init/sysvinit/vdsmd.init.in
+@@ -117,8 +117,7 @@ test_already_running()
+ reconfigure_libvirt() {
+     local force
+     [ "${1}" = "force" ] && force="--force"
+-    "$VDSM_TOOL" libvirt-configure ${force} &&
+-        "$VDSM_TOOL" libvirt-configure-services-restart
++    "$VDSM_TOOL" libvirt-configure ${force}
+ }
+ 
+ start() {
+diff --git a/lib/vdsm/tool/libvirt_configure.sh.in b/lib/vdsm/tool/libvirt_configure.sh.in
+index 18ebe60..cf70f59 100755
+--- a/lib/vdsm/tool/libvirt_configure.sh.in
++++ b/lib/vdsm/tool/libvirt_configure.sh.in
+@@ -291,15 +291,10 @@ EOF
+         ovirt_store_config "${lconf}" "${qconf}" "${ldconf}" "${llogr}"
+     fi
+ 
++    /usr/bin/vdsm-tool libvirt-configure-services-restart || return 1
++
+     echo "Reconfiguration of libvirt is done."
+     echo
+-    cat << __EOF__
+-To start working with the new configuration, execute:
+-'vdsm-tool libvirt-configure-services-restart'
+-This will manage restarting of the following services:
+-libvirtd, supervdsmd
+-__EOF__
+-    echo
+ 
+     #
+     # finished reconfiguration, do not trigger
+diff --git a/vdsm.spec.in b/vdsm.spec.in
+index 5e306e4..26cf267 100644
+--- a/vdsm.spec.in
++++ b/vdsm.spec.in
+@@ -748,10 +748,9 @@ if [ "$1" -ge 1 ]; then
+         %{_bindir}/vdsm-tool service-stop supervdsmd >/dev/null 2>&1
+         supervdsmd_start_required='yes'
+     fi
+-    if %{_bindir}/vdsm-tool libvirt-configure | grep -q 'is done.'; then
+-        if %{_bindir}/vdsm-tool service-status libvirtd >/dev/null 2>&1; then
+-            %{_bindir}/vdsm-tool service-restart libvirtd >/dev/null 2>&1
+-        fi
++
++    %{_bindir}/vdsm-tool libvirt-configure >/dev/null 2>&1
++
+     fi
+     if [ "${supervdsmd_start_required}" = 'yes' ]; then
+         %{_bindir}/vdsm-tool service-start supervdsmd >/dev/null 2>&1
+-- 
+1.8.4.2
+
diff --git a/0012-vdsm-Accents-in-the-vm-name-break-the-migration.patch b/0012-vdsm-Accents-in-the-vm-name-break-the-migration.patch
new file mode 100644
index 0000000..142b9dd
--- /dev/null
+++ b/0012-vdsm-Accents-in-the-vm-name-break-the-migration.patch
@@ -0,0 +1,36 @@
+From 36d8edd5fe8b0ca13f4e0a4aa2e649e6435373b6 Mon Sep 17 00:00:00 2001
+From: Martin Betak <mbetak at redhat.com>
+Date: Mon, 30 Sep 2013 14:35:36 +0200
+Subject: [PATCH 12/21] vdsm: Accents in the vm name break the migration
+
+Added utf-8 encoding of the configuration xml on the destination to
+handle non-ascii characters.
+
+Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1002246
+Change-Id: I9db5ea4f0745ef42633e3d265bcf40fb4733b2ce
+Signed-off-by: Martin Betak <mbetak at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/19684
+Reviewed-by: Federico Simoncelli <fsimonce at redhat.com>
+Reviewed-by: Michal Skrivanek <michal.skrivanek at redhat.com>
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21521
+---
+ vdsm/vm.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vdsm/vm.py b/vdsm/vm.py
+index 0921fb2..7e986a9 100644
+--- a/vdsm/vm.py
++++ b/vdsm/vm.py
+@@ -4910,7 +4910,7 @@ class Vm(object):
+         if not self._pathsPreparedEvent.isSet():
+             self.log.debug('Timeout while waiting for path preparation')
+             return False
+-        srcDomXML = self.conf.pop('_srcDomXML')
++        srcDomXML = self.conf.pop('_srcDomXML').encode('utf-8')
+         self._updateDevicesDomxmlCache(srcDomXML)
+ 
+         for dev in self._customDevices():
+-- 
+1.8.4.2
+
diff --git a/0013-Ensure-cancellation-of-migrations-gets-handled-corre.patch b/0013-Ensure-cancellation-of-migrations-gets-handled-corre.patch
new file mode 100644
index 0000000..4d1992f
--- /dev/null
+++ b/0013-Ensure-cancellation-of-migrations-gets-handled-corre.patch
@@ -0,0 +1,93 @@
+From fd7dffbea5f3b2b5510f64f5e748c475ed2df49f Mon Sep 17 00:00:00 2001
+From: Martin Polednik <mpoledni at redhat.com>
+Date: Wed, 20 Nov 2013 08:17:34 +0100
+Subject: [PATCH 13/21] Ensure cancellation of migrations gets handled
+ correctly
+
+If the migration is cancelled before the source calls libvirt.migrateToURI2
+we have to raise an libvirtError with the VIR_ERROR_OPERATION_ABORTED error
+code to ensure that _finishSuccessfully() does not get called and we're
+correctly reporting that the migration has been cancelled and that we're
+destroying the VM on the destination in the process, since we're bailing
+out.
+
+Additionally we'll do the check if the migration has been cancelled
+right after the semaphore has been accquired, to avoid doing things
+like calling the before_vm_migration_source hook and calling the
+destination vdsm to create the VM instance.
+
+Change-Id: Id271a41466bc355ca505f764206457af419f0edd
+Bug-Url: https://bugzilla.redhat.com/1023131
+Signed-off-by: Martin Polednik <mpoledni at redhat.com>
+Signed-off-by: Vinzenz Feenstra <vfeenstr at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21445
+Reviewed-by: Michal Skrivanek <michal.skrivanek at redhat.com>
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21536
+---
+ vdsm/vm.py | 21 +++++++++++++++++++--
+ 1 file changed, 19 insertions(+), 2 deletions(-)
+
+diff --git a/vdsm/vm.py b/vdsm/vm.py
+index 7e986a9..f2971fe 100644
+--- a/vdsm/vm.py
++++ b/vdsm/vm.py
+@@ -145,7 +145,7 @@ class MigrationSourceThread(threading.Thread):
+                 'message': 'Migration in progress'},
+             'progress': 0}
+         threading.Thread.__init__(self)
+-        self._preparingMigrationEvt = False
++        self._preparingMigrationEvt = True
+         self._migrationCanceledEvt = False
+         self._monitorThread = None
+ 
+@@ -288,6 +288,19 @@ class MigrationSourceThread(threading.Thread):
+         # vdsm < 4.13 expect this to exist
+         self._machineParams['afterMigrationStatus'] = ''
+ 
++    @staticmethod
++    def _raiseAbortError():
++        e = libvirt.libvirtError(defmsg='')
++        # we have to override the value to get what we want
++        # err might be None
++        e.err = (libvirt.VIR_ERR_OPERATION_ABORTED,  # error code
++                 libvirt.VIR_FROM_QEMU,              # error domain
++                 'operation aborted',                # error message
++                 libvirt.VIR_ERR_WARNING,            # error level
++                 '', '', '',                         # str1, str2, str3,
++                 -1, -1)                             # int1, int2
++        raise e
++
+     def run(self):
+         try:
+             mstate = ''
+@@ -296,6 +309,8 @@ class MigrationSourceThread(threading.Thread):
+             self._prepareGuest()
+             MigrationSourceThread._ongoingMigrations.acquire()
+             try:
++                if self._migrationCanceledEvt:
++                    self._raiseAbortError()
+                 self.log.debug("migration semaphore acquired")
+                 if not mstate:
+                     self._vm.conf['_migrationParams'] = {
+@@ -321,7 +336,6 @@ class MigrationSourceThread(threading.Thread):
+             self.log.error("Failed to migrate", exc_info=True)
+ 
+     def _startUnderlyingMigration(self):
+-        self._preparingMigrationEvt = True
+         if self._mode == 'file':
+             hooks.before_vm_hibernate(self._vm._dom.XMLDesc(0), self._vm.conf)
+             try:
+@@ -383,6 +397,9 @@ class MigrationSourceThread(threading.Thread):
+                         (libvirt.VIR_MIGRATE_TUNNELLED if
+                             self._tunneled else 0),
+                         None, maxBandwidth)
++                else:
++                    self._raiseAbortError()
++
+             finally:
+                 t.cancel()
+                 if MigrationMonitorThread._MIGRATION_MONITOR_INTERVAL:
+-- 
+1.8.4.2
+
diff --git a/0014-Keeping-gluster-modules-when-with_gluster-set-to-0.patch b/0014-Keeping-gluster-modules-when-with_gluster-set-to-0.patch
new file mode 100644
index 0000000..0dcc754
--- /dev/null
+++ b/0014-Keeping-gluster-modules-when-with_gluster-set-to-0.patch
@@ -0,0 +1,104 @@
+From 3c07e78f63e21b530c897947ddf95b4ceea679d3 Mon Sep 17 00:00:00 2001
+From: Yaniv Bronhaim <ybronhei at redhat.com>
+Date: Wed, 20 Nov 2013 18:21:26 +0200
+Subject: [PATCH 14/21] Keeping gluster modules when with_gluster set to 0
+
+Currently the code imports and uses gluster modules. Setting
+with_gluster=0 brakes the code. With this patch with_gluster=0 will
+only drop the vdsm-gluster rpm creation.
+
+This patch was reviewed on - http://gerrit.ovirt.org/21477 &&
+http://gerrit.ovirt.org/#/c/21625/ (as a join of both patches)
+
+Change-Id: I1cdbd8b399652bf0d306308e2d4cfc0014be689c
+Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21577
+---
+ vdsm.spec.in                  |  8 --------
+ vdsm/storage/glusterVolume.py |  6 +++++-
+ vdsm/supervdsmServer          | 12 +++++++++---
+ 3 files changed, 14 insertions(+), 12 deletions(-)
+
+diff --git a/vdsm.spec.in b/vdsm.spec.in
+index 26cf267..08119d9 100644
+--- a/vdsm.spec.in
++++ b/vdsm.spec.in
+@@ -894,12 +894,8 @@ exit 0
+ %{_datadir}/%{vdsm_name}/storage/fileUtils.py*
+ %{_datadir}/%{vdsm_name}/storage/fileVolume.py*
+ %{_datadir}/%{vdsm_name}/storage/fuser.py*
+-%if 0%{?with_gluster}
+ %{_datadir}/%{vdsm_name}/storage/glusterSD.py*
+ %{_datadir}/%{vdsm_name}/storage/glusterVolume.py*
+-%else
+-%exclude %{_datadir}/%{vdsm_name}/storage/gluster*
+-%endif
+ %{_datadir}/%{vdsm_name}/storage/hba.py*
+ %{_datadir}/%{vdsm_name}/storage/hsm.py*
+ %{_datadir}/%{vdsm_name}/storage/image.py*
+@@ -1085,14 +1081,10 @@ exit 0
+ %{_datadir}/%{vdsm_name}/tests/netmaskconversions
+ %{_datadir}/%{vdsm_name}/tests/run_tests.sh
+ %{_datadir}/%{vdsm_name}/tests/tc_filter_show.out
+-%if 0%{?with_gluster}
+ %{_datadir}/%{vdsm_name}/tests/glusterVolumeProfileInfo.xml
+ %{_datadir}/%{vdsm_name}/tests/glusterVolumeProfileInfoNfs.xml
+ %{_datadir}/%{vdsm_name}/tests/glusterVolumeRebalanceStatus.xml
+ %{_datadir}/%{vdsm_name}/tests/glusterVolumeRemoveBricksStatus.xml
+-%else
+-%exclude %{_datadir}/%{vdsm_name}/tests/gluster*
+-%endif
+ %{_datadir}/%{vdsm_name}/tests/functional/*.py*
+ %{_datadir}/%{vdsm_name}/tests/functional/*.policy
+ 
+diff --git a/vdsm/storage/glusterVolume.py b/vdsm/storage/glusterVolume.py
+index 3368de3..647b1ec 100644
+--- a/vdsm/storage/glusterVolume.py
++++ b/vdsm/storage/glusterVolume.py
+@@ -2,7 +2,11 @@ from volume import VmVolumeInfo
+ import fileVolume
+ from sdc import sdCache
+ import supervdsm as svdsm
+-from gluster.exception import GlusterException
++try:
++    from gluster.exception import GlusterException
++    _glusterEnabled = True
++except ImportError:
++    _glusterEnabled = False
+ 
+ 
+ class GlusterVolume(fileVolume.FileVolume):
+diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
+index 40ec9df..7fa1c2b 100755
+--- a/vdsm/supervdsmServer
++++ b/vdsm/supervdsmServer
+@@ -43,7 +43,12 @@ except:
+ 
+ from storage import fuser
+ from multiprocessing import Pipe, Process
+-from gluster import listPublicFunctions
++try:
++    from gluster import listPublicFunctions
++    _glusterEnabled = True
++except ImportError:
++    _glusterEnabled = False
++
+ import storage.misc as misc
+ from vdsm import utils
+ from parted_utils import getDevicePartedInfo as _getDevicePartedInfo
+@@ -362,8 +367,9 @@ def main(sockfile, pidfile=None):
+             return func(*args, **kwargs)
+         return wrapper
+ 
+-    for name, func in listPublicFunctions():
+-        setattr(_SuperVdsm, name, logDecorator(bind(func)))
++    if _glusterEnabled:
++        for name, func in listPublicFunctions():
++            setattr(_SuperVdsm, name, logDecorator(bind(func)))
+ 
+     try:
+         log.debug("Making sure I'm root - SuperVdsm")
+-- 
+1.8.4.2
+
diff --git a/0015-Migration-cancellation-replies-wrong-message-format.patch b/0015-Migration-cancellation-replies-wrong-message-format.patch
new file mode 100644
index 0000000..0723e6c
--- /dev/null
+++ b/0015-Migration-cancellation-replies-wrong-message-format.patch
@@ -0,0 +1,47 @@
+From 618e0d4a8ec3f6b7ca0719d14f8231e0cd50e5f9 Mon Sep 17 00:00:00 2001
+From: Vinzenz Feenstra <vfeenstr at redhat.com>
+Date: Thu, 14 Nov 2013 08:47:55 +0100
+Subject: [PATCH 15/21] Migration cancellation replies wrong message format
+
+The message currently returns:
+
+{'status': {'message': 'Migration canceled',
+            'code': { 'status': { 'message': 'Migration not in progress',
+                      'code': 47}}},
+            'progress': 1}
+
+The content of code is wrong. This commit fixes it so the message will
+look like this:
+
+{'status': {'message': 'Migration canceled', 'code': 47}, 'progress': 1}
+
+Change-Id: I17a2463154e9f67191a818f137a4e7158a74dbbb
+Bug-Url: https://bugzilla.redhat.com/1015887
+Signed-off-by: Vinzenz Feenstra <vfeenstr at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21250
+Reviewed-by: Michal Skrivanek <michal.skrivanek at redhat.com>
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21700
+Tested-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
+---
+ vdsm/vm.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/vdsm/vm.py b/vdsm/vm.py
+index f2971fe..22d7a2d 100644
+--- a/vdsm/vm.py
++++ b/vdsm/vm.py
+@@ -324,7 +324,8 @@ class MigrationSourceThread(threading.Thread):
+                 self._finishSuccessfully()
+             except libvirt.libvirtError as e:
+                 if e.get_error_code() == libvirt.VIR_ERR_OPERATION_ABORTED:
+-                    self.status['status']['code'] = errCode['migCancelErr']
++                    self.status['status']['code'] = \
++                        errCode['migCancelErr']['status']['code']
+                     self.status['status']['message'] = 'Migration canceled'
+                 raise
+             finally:
+-- 
+1.8.4.2
+
diff --git a/0016-F20-netinfo-fix-linkShowDev-parsing-in-getVlanID.patch b/0016-F20-netinfo-fix-linkShowDev-parsing-in-getVlanID.patch
new file mode 100644
index 0000000..9a738ab
--- /dev/null
+++ b/0016-F20-netinfo-fix-linkShowDev-parsing-in-getVlanID.patch
@@ -0,0 +1,66 @@
+From 06a2dbc7c28ea0985ce6166240ba621a924cd3bf Mon Sep 17 00:00:00 2001
+From: "Antoni S. Puimedon" <asegurap at redhat.com>
+Date: Wed, 27 Nov 2013 01:35:52 +0100
+Subject: [PATCH 16/21] F20 netinfo: fix linkShowDev parsing in getVlanID
+
+Newer linux distributions return more detailed information for each
+link. Where before we had:
+
+    3: enp3s0.11 at enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
+        link/ether c8:60:00:99:01:37 brd ff:ff:ff:ff:ff:ff promiscuity 0
+        vlan id 11 <REORDER_HDR>
+
+Now we have:
+
+    3: enp3s0.11 at enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
+        link/ether c8:60:00:99:01:37 brd ff:ff:ff:ff:ff:ff promiscuity 0
+        vlan protocol 802.1Q id 11 <REORDER_HDR>
+
+Thus, since after the vlan type indication we can have several key, value
+pairs, it is necessary to change the parsing so that it looks at the keys
+to decide if it's the value we want.
+
+This patch is a very very partial backport of the master branch fix:
+    http://gerrit.ovirt.org/#/c/21054/
+That patch was very complex and introduced different behaviors that
+are not suitable for a backport such as the one this patch is doing.
+
+Change-Id: I6fbc492d2eee88e856e893ad69fe7552ede30b1a
+Signed-off-by: Antoni S. Puimedon <asegurap at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21759
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
+---
+ lib/vdsm/netinfo.py | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
+index ba78dc9..790c099 100644
+--- a/lib/vdsm/netinfo.py
++++ b/lib/vdsm/netinfo.py
+@@ -568,15 +568,15 @@ def getVlanDevice(vlan):
+ 
+ def getVlanID(vlan):
+     """ Return the ID of the given VLAN. """
+-    vlanId = None
+     out = linkShowDev(vlan)
+ 
+-    for item in out:
+-        if "vlan id" in item:
+-            vlanId = item.split()[2]
+-            break
+-
+-    return int(vlanId)
++    vlanPos = out[2].find('vlan')
++    if vlanPos == -1:
++        raise ValueError('device %s does not seem to be a vlan' % vlan)
++    tokens = [token.strip() for token in out[2][vlanPos:].split(' ')]
++    for index, token in enumerate(tokens):
++        if "id" == token:
++            return int(tokens[index + 1])
+ 
+ 
+ def getIpAddresses():
+-- 
+1.8.4.2
+
diff --git a/0017-fuserTests-fix-for-f20-and-arch.patch b/0017-fuserTests-fix-for-f20-and-arch.patch
new file mode 100644
index 0000000..339a0f0
--- /dev/null
+++ b/0017-fuserTests-fix-for-f20-and-arch.patch
@@ -0,0 +1,45 @@
+From df42ad1ec8f78a6c934c539cbe37efbd2d614009 Mon Sep 17 00:00:00 2001
+From: "Antoni S. Puimedon" <asegurap at redhat.com>
+Date: Tue, 5 Nov 2013 15:11:19 +0100
+Subject: [PATCH 17/21] fuserTests fix for f20 and arch
+
+In newer distributions, fuser doesn't report a process as accessing
+it's own executable file, making this test fail. We don't know why
+this has changed (tried with newer kernels and newer fuser and the
+issue persists) but we do not care enough about fuser reporting all
+the pids from the processes created and alive of an executable file.
+We fix this test for the fuser use case that we have.
+
+Change-Id: I9ead0d5dbed6a9373f1437f6484ba2f2ce108c2b
+Signed-off-by: Antoni S. Puimedon <asegurap at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/20921
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21740
+Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Tested-by: Yaniv Bronhaim <ybronhei at redhat.com>
+---
+ tests/fuserTests.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/tests/fuserTests.py b/tests/fuserTests.py
+index 7473dde..6516758 100644
+--- a/tests/fuserTests.py
++++ b/tests/fuserTests.py
+@@ -19,6 +19,7 @@
+ #
+ 
+ import os
++from tempfile import NamedTemporaryFile
+ from storage import fuser
+ 
+ from testrunner import VdsmTestCase
+@@ -28,4 +29,5 @@ class TestFuser(VdsmTestCase):
+ 
+     def testSelfExe(self):
+         pid = os.getpid()
+-        self.assertTrue(pid in fuser.fuser('/proc/%s/exe' % pid))
++        with NamedTemporaryFile() as tempFile:
++            self.assertTrue(pid in fuser.fuser(tempFile.name))
+-- 
+1.8.4.2
+
diff --git a/0018-Adding-debian-folder-makefile.patch b/0018-Adding-debian-folder-makefile.patch
new file mode 100644
index 0000000..4d504f0
--- /dev/null
+++ b/0018-Adding-debian-folder-makefile.patch
@@ -0,0 +1,150 @@
+From c4c8f5c63c4afd3bf0ccde8d0c3e80470310d6fc Mon Sep 17 00:00:00 2001
+From: Yaniv Bronhaim <ybronhei at redhat.com>
+Date: Tue, 26 Nov 2013 11:10:23 +0200
+Subject: [PATCH 18/21] Adding debian folder makefile
+
+Change-Id: I31dad533c70b501c3d521364bd98eb30517d2f3f
+Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21695
+Reviewed-by: Sandro Bonazzola <sbonazzo at redhat.com>
+Reviewed-by: Kiril Nesenko <knesenko at redhat.com>
+Reviewed-by: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
+Tested-by: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21795
+---
+ Makefile.am        |  1 +
+ configure.ac       |  1 +
+ debian/Makefile.am | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 98 insertions(+)
+ create mode 100644 debian/Makefile.am
+
+diff --git a/Makefile.am b/Makefile.am
+index 195688f..d71ee28 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -20,6 +20,7 @@
+ 
+ SUBDIRS = \
+ 	client \
++	debian \
+ 	init \
+ 	lib \
+ 	vds_bootstrap \
+diff --git a/configure.ac b/configure.ac
+index 93b6b96..fac9755 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -247,6 +247,7 @@ AC_PATH_PROG([YUM_PATH], [yum], [/usr/bin/yum])
+ AC_OUTPUT([
+ 	Makefile
+ 	client/Makefile
++	debian/Makefile
+ 	init/Makefile
+ 	init/systemd/Makefile
+ 	init/sysvinit/Makefile
+diff --git a/debian/Makefile.am b/debian/Makefile.am
+new file mode 100644
+index 0000000..67cb2d2
+--- /dev/null
++++ b/debian/Makefile.am
+@@ -0,0 +1,96 @@
++#
++# Copyright 2013 Hat, Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++#
++# Refer to the README and COPYING files for full details of the license
++#
++include $(top_srcdir)/build-aux/Makefile.subs
++
++EXTRA_DIST = \
++    changelog \
++    compat \
++    control \
++    copyright \
++    dependencyMap.txt \
++    README.Debian \
++    rules \
++    source \
++    TODO \
++    vdsm-client.docs \
++    vdsm-client.install \
++    vdsm.dirs \
++    vdsm.docs \
++    vdsm-gluster.docs \
++    vdsm-gluster.install \
++    vdsm-hook-checkimages.docs \
++    vdsm-hook-checkimages.install \
++    vdsm-hook-directlun.docs \
++    vdsm-hook-directlun.install \
++    vdsm-hook-faqemu.docs \
++    vdsm-hook-faqemu.install \
++    vdsm-hook-fileinject.docs \
++    vdsm-hook-fileinject.install \
++    vdsm-hook-floppy.docs \
++    vdsm-hook-floppy.install \
++    vdsm-hook-hostusb.docs \
++    vdsm-hook-hostusb.install \
++    vdsm-hook-hugepages.docs \
++    vdsm-hook-hugepages.install \
++    vdsm-hook-isolatedprivatevlan.docs \
++    vdsm-hook-isolatedprivatevlan.install \
++    vdsm-hook-macspoof.docs \
++    vdsm-hook-macspoof.install \
++    vdsm-hook-nestedvt.docs \
++    vdsm-hook-nestedvt.install \
++    vdsm-hook-numa.docs \
++    vdsm-hook-numa.install \
++    vdsm-hook-openstacknet.docs \
++    vdsm-hook-openstacknet.install \
++    vdsm-hook-pincpu.docs \
++    vdsm-hook-pincpu.install \
++    vdsm-hook-promisc.docs \
++    vdsm-hook-promisc.install \
++    vdsm-hook-qemucmdline.docs \
++    vdsm-hook-qemucmdline.install \
++    vdsm-hook-qos.docs \
++    vdsm-hook-qos.install \
++    vdsm-hook-scratchpad.docs \
++    vdsm-hook-scratchpad.install \
++    vdsm-hook-smbios.docs \
++    vdsm-hook-smbios.install \
++    vdsm-hook-sriov.docs \
++    vdsm-hook-sriov.install \
++    vdsm-hook-vhostmd.docs \
++    vdsm-hook-vhostmd.install \
++    vdsm-hook-vmdisk.docs \
++    vdsm-hook-vmdisk.install \
++    vdsm-hook-vmfex.docs \
++    vdsm-hook-vmfex.install \
++    vdsm.install \
++    vdsm.postinst \
++    vdsm.postrm \
++    vdsm.preinst \
++    vdsm.prerm \
++    vdsm-python.docs \
++    vdsm-python.install \
++    vdsm-python-zombiereaper.docs \
++    vdsm-python-zombiereaper.install \
++    vdsm-tests.docs \
++    vdsm-tests.install \
++    vdsm-yajsonrpc.docs \
++    vdsm-yajsonrpc.install \
++    watch \
++    $(NULL)
+-- 
+1.8.4.2
+
diff --git a/0019-Fix-Makefile.am-in-debian-folder.patch b/0019-Fix-Makefile.am-in-debian-folder.patch
new file mode 100644
index 0000000..92a07c1
--- /dev/null
+++ b/0019-Fix-Makefile.am-in-debian-folder.patch
@@ -0,0 +1,172 @@
+From 7c493590933bf80e01e0cb87e30a2d1e48ab7f39 Mon Sep 17 00:00:00 2001
+From: Yaniv Bronhaim <ybronhei at redhat.com>
+Date: Wed, 27 Nov 2013 17:41:36 +0200
+Subject: [PATCH 19/21] Fix Makefile.am in debian folder.
+
+Change-Id: I30278a5d8046a1e87896426d2eb8aa6b93863a51
+Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Signed-off-by: Kiril Nesenko <knesenko at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21798
+---
+ debian/Makefile.am | 148 ++++++++++++++++++++++++++---------------------------
+ 1 file changed, 74 insertions(+), 74 deletions(-)
+
+diff --git a/debian/Makefile.am b/debian/Makefile.am
+index 67cb2d2..25e79c3 100644
+--- a/debian/Makefile.am
++++ b/debian/Makefile.am
+@@ -20,77 +20,77 @@
+ include $(top_srcdir)/build-aux/Makefile.subs
+ 
+ EXTRA_DIST = \
+-    changelog \
+-    compat \
+-    control \
+-    copyright \
+-    dependencyMap.txt \
+-    README.Debian \
+-    rules \
+-    source \
+-    TODO \
+-    vdsm-client.docs \
+-    vdsm-client.install \
+-    vdsm.dirs \
+-    vdsm.docs \
+-    vdsm-gluster.docs \
+-    vdsm-gluster.install \
+-    vdsm-hook-checkimages.docs \
+-    vdsm-hook-checkimages.install \
+-    vdsm-hook-directlun.docs \
+-    vdsm-hook-directlun.install \
+-    vdsm-hook-faqemu.docs \
+-    vdsm-hook-faqemu.install \
+-    vdsm-hook-fileinject.docs \
+-    vdsm-hook-fileinject.install \
+-    vdsm-hook-floppy.docs \
+-    vdsm-hook-floppy.install \
+-    vdsm-hook-hostusb.docs \
+-    vdsm-hook-hostusb.install \
+-    vdsm-hook-hugepages.docs \
+-    vdsm-hook-hugepages.install \
+-    vdsm-hook-isolatedprivatevlan.docs \
+-    vdsm-hook-isolatedprivatevlan.install \
+-    vdsm-hook-macspoof.docs \
+-    vdsm-hook-macspoof.install \
+-    vdsm-hook-nestedvt.docs \
+-    vdsm-hook-nestedvt.install \
+-    vdsm-hook-numa.docs \
+-    vdsm-hook-numa.install \
+-    vdsm-hook-openstacknet.docs \
+-    vdsm-hook-openstacknet.install \
+-    vdsm-hook-pincpu.docs \
+-    vdsm-hook-pincpu.install \
+-    vdsm-hook-promisc.docs \
+-    vdsm-hook-promisc.install \
+-    vdsm-hook-qemucmdline.docs \
+-    vdsm-hook-qemucmdline.install \
+-    vdsm-hook-qos.docs \
+-    vdsm-hook-qos.install \
+-    vdsm-hook-scratchpad.docs \
+-    vdsm-hook-scratchpad.install \
+-    vdsm-hook-smbios.docs \
+-    vdsm-hook-smbios.install \
+-    vdsm-hook-sriov.docs \
+-    vdsm-hook-sriov.install \
+-    vdsm-hook-vhostmd.docs \
+-    vdsm-hook-vhostmd.install \
+-    vdsm-hook-vmdisk.docs \
+-    vdsm-hook-vmdisk.install \
+-    vdsm-hook-vmfex.docs \
+-    vdsm-hook-vmfex.install \
+-    vdsm.install \
+-    vdsm.postinst \
+-    vdsm.postrm \
+-    vdsm.preinst \
+-    vdsm.prerm \
+-    vdsm-python.docs \
+-    vdsm-python.install \
+-    vdsm-python-zombiereaper.docs \
+-    vdsm-python-zombiereaper.install \
+-    vdsm-tests.docs \
+-    vdsm-tests.install \
+-    vdsm-yajsonrpc.docs \
+-    vdsm-yajsonrpc.install \
+-    watch \
+-    $(NULL)
++	changelog \
++	compat \
++	control \
++	copyright \
++	dependencyMap.txt \
++	README.Debian \
++	rules \
++	source \
++	TODO \
++	vdsm-client.docs \
++	vdsm-client.install \
++	vdsm.dirs \
++	vdsm.docs \
++	vdsm-gluster.docs \
++	vdsm-gluster.install \
++	vdsm-hook-checkimages.docs \
++	vdsm-hook-checkimages.install \
++	vdsm-hook-directlun.docs \
++	vdsm-hook-directlun.install \
++	vdsm-hook-faqemu.docs \
++	vdsm-hook-faqemu.install \
++	vdsm-hook-fileinject.docs \
++	vdsm-hook-fileinject.install \
++	vdsm-hook-floppy.docs \
++	vdsm-hook-floppy.install \
++	vdsm-hook-hostusb.docs \
++	vdsm-hook-hostusb.install \
++	vdsm-hook-hugepages.docs \
++	vdsm-hook-hugepages.install \
++	vdsm-hook-isolatedprivatevlan.docs \
++	vdsm-hook-isolatedprivatevlan.install \
++	vdsm-hook-macspoof.docs \
++	vdsm-hook-macspoof.install \
++	vdsm-hook-nestedvt.docs \
++	vdsm-hook-nestedvt.install \
++	vdsm-hook-numa.docs \
++	vdsm-hook-numa.install \
++	vdsm-hook-openstacknet.docs \
++	vdsm-hook-openstacknet.install \
++	vdsm-hook-pincpu.docs \
++	vdsm-hook-pincpu.install \
++	vdsm-hook-promisc.docs \
++	vdsm-hook-promisc.install \
++	vdsm-hook-qemucmdline.docs \
++	vdsm-hook-qemucmdline.install \
++	vdsm-hook-qos.docs \
++	vdsm-hook-qos.install \
++	vdsm-hook-scratchpad.docs \
++	vdsm-hook-scratchpad.install \
++	vdsm-hook-smbios.docs \
++	vdsm-hook-smbios.install \
++	vdsm-hook-sriov.docs \
++	vdsm-hook-sriov.install \
++	vdsm-hook-vhostmd.docs \
++	vdsm-hook-vhostmd.install \
++	vdsm-hook-vmdisk.docs \
++	vdsm-hook-vmdisk.install \
++	vdsm-hook-vmfex.docs \
++	vdsm-hook-vmfex.install \
++	vdsm.install \
++	vdsm.postinst \
++	vdsm.postrm \
++	vdsm.preinst \
++	vdsm.prerm \
++	vdsm-python-cpopen.docs \
++	vdsm-python-cpopen.install \
++	vdsm-python.docs \
++	vdsm-python.install \
++	vdsm-tests.docs \
++	vdsm-tests.install \
++	vdsm-yajsonrpc.docs \
++	vdsm-yajsonrpc.install \
++	watch \
++	$(NULL)
+-- 
+1.8.4.2
+
diff --git a/0020-Disable-exception-on-after-hooks-failures.patch b/0020-Disable-exception-on-after-hooks-failures.patch
new file mode 100644
index 0000000..1cce686
--- /dev/null
+++ b/0020-Disable-exception-on-after-hooks-failures.patch
@@ -0,0 +1,79 @@
+From 8dc7063183b4d3d3e0d809214a5df786bdcd105b Mon Sep 17 00:00:00 2001
+From: Yaniv Bronhaim <ybronhei at redhat.com>
+Date: Wed, 20 Nov 2013 16:07:21 +0200
+Subject: [PATCH 20/21] Disable exception on after hooks failures
+
+Adding to all after hooks - raiseError=False
+
+Change-Id: Ia3cc7b8e11f0e5b31984aaae9d9c47bd948b80c7
+Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21464
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21767
+---
+ vdsm/hooks.py | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/vdsm/hooks.py b/vdsm/hooks.py
+index a1f8158..8b74907 100644
+--- a/vdsm/hooks.py
++++ b/vdsm/hooks.py
+@@ -110,7 +110,7 @@ def before_device_create(devicexml, vmconf={}, customProperties={}):
+ 
+ def after_device_create(devicexml, vmconf={}, customProperties={}):
+     return _runHooksDir(devicexml, 'after_device_create', vmconf=vmconf,
+-                        params=customProperties)
++                        params=customProperties, raiseError=False)
+ 
+ 
+ def before_device_destroy(devicexml, vmconf={}, customProperties={}):
+@@ -120,7 +120,7 @@ def before_device_destroy(devicexml, vmconf={}, customProperties={}):
+ 
+ def after_device_destroy(devicexml, vmconf={}, customProperties={}):
+     return _runHooksDir(devicexml, 'after_device_destroy', vmconf=vmconf,
+-                        params=customProperties)
++                        params=customProperties, raiseError=False)
+ 
+ 
+ def before_vm_start(domxml, vmconf={}):
+@@ -157,7 +157,8 @@ def before_device_migrate_source(devicexml, vmconf={}, customProperties={}):
+ 
+ def after_device_migrate_source(devicexml, vmconf={}, customProperties={}):
+     return _runHooksDir(devicexml, 'after_device_migrate_source',
+-                        vmconf=vmconf, params=customProperties)
++                        vmconf=vmconf, params=customProperties,
++                        raiseError=False)
+ 
+ 
+ def before_device_migrate_destination(
+@@ -169,7 +170,8 @@ def before_device_migrate_destination(
+ def after_device_migrate_destination(
+         devicexml, vmconf={}, customProperties={}):
+     return _runHooksDir(devicexml, 'after_device_migrate_destination',
+-                        vmconf=vmconf, params=customProperties)
++                        vmconf=vmconf, params=customProperties,
++                        raiseError=False)
+ 
+ 
+ def before_vm_migrate_source(domxml, vmconf={}):
+@@ -281,7 +283,7 @@ def before_disk_hotplug(domxml, vmconf={}, params={}):
+ 
+ def after_disk_hotplug(domxml, vmconf={}, params={}):
+     return _runHooksDir(domxml, 'after_disk_hotplug', vmconf=vmconf,
+-                        params=params)
++                        params=params, raiseError=False)
+ 
+ 
+ def before_disk_hotunplug(domxml, vmconf={}, params={}):
+@@ -291,7 +293,7 @@ def before_disk_hotunplug(domxml, vmconf={}, params={}):
+ 
+ def after_disk_hotunplug(domxml, vmconf={}, params={}):
+     return _runHooksDir(domxml, 'after_disk_hotunplug', vmconf=vmconf,
+-                        params=params)
++                        params=params, raiseError=False)
+ 
+ 
+ def before_vdsm_start():
+-- 
+1.8.4.2
+
diff --git a/0021-vm-Fix-vm-unpausing-during-recovery.patch b/0021-vm-Fix-vm-unpausing-during-recovery.patch
new file mode 100644
index 0000000..3ebc943
--- /dev/null
+++ b/0021-vm-Fix-vm-unpausing-during-recovery.patch
@@ -0,0 +1,119 @@
+From c56375d5cdbf747405008a592d81f531c37053c3 Mon Sep 17 00:00:00 2001
+From: Nir Soffer <nsoffer at redhat.com>
+Date: Mon, 25 Nov 2013 14:40:37 +0200
+Subject: [PATCH 21/21] vm: Fix vm unpausing during recovery
+
+Domain monitor thread was not reporting when going from unknown state to
+known state. The thread would start with a bogus valid state, before
+checking the domain. If the first domain check found the domain as
+valid, no notification was emitted. If there were paused vms while
+connecting to the pool, they were not unpaused as they should.
+
+This patch fixes various modules:
+
+- Domain monitor status lastCheck is initialized now to special
+  NOT_CHECKED_YET value. The monitor thread use this value to detect the
+  first sample, and emit the missing notification.
+
+- To get the new event when monitor thread starts, domain state change
+  callbacks are registered now *before* the monitor threads are started.
+
+- To get the vm unpause code to work in recovery mode, the Vm.sdIds is
+  initialized in Vm._run. This probably fixes other issues with
+  recovered vms.
+
+This is a backport of http://gerrit.ovirt.org/21649.
+
+Change-Id: I56c468edb967de5bcf15259029ace84333fc4b7e
+Bug-Url: https://bugzilla.redhat.com/1003588
+Signed-off-by: Nir Soffer <nsoffer at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21782
+Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Tested-by: Yaniv Bronhaim <ybronhei at redhat.com>
+---
+ vdsm/storage/domainMonitor.py | 10 ++++++++--
+ vdsm/storage/hsm.py           | 10 +++++++---
+ vdsm/vm.py                    |  4 ++++
+ 3 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/vdsm/storage/domainMonitor.py b/vdsm/storage/domainMonitor.py
+index a998f80..ffa5e00 100644
+--- a/vdsm/storage/domainMonitor.py
++++ b/vdsm/storage/domainMonitor.py
+@@ -27,6 +27,8 @@ import misc
+ from vdsm.config import config
+ from sdc import sdCache
+ 
++NOT_CHECKED_YET = -1
++
+ 
+ class DomainMonitorStatus(object):
+     __slots__ = (
+@@ -41,7 +43,7 @@ class DomainMonitorStatus(object):
+ 
+     def clear(self):
+         self.error = None
+-        self.lastCheck = time()
++        self.lastCheck = NOT_CHECKED_YET
+         self.valid = True
+         self.readDelay = 0
+         self.diskUtilization = (None, None)
+@@ -228,7 +230,7 @@ class DomainMonitorThread(object):
+         self.nextStatus.lastCheck = time()
+         self.nextStatus.valid = (self.nextStatus.error is None)
+ 
+-        if self.status.valid != self.nextStatus.valid:
++        if self._statusDidChange():
+             self.log.debug("Domain %s changed its status to %s", self.sdUUID,
+                            "Valid" if self.nextStatus.valid else "Invalid")
+ 
+@@ -250,3 +252,7 @@ class DomainMonitorThread(object):
+                                self.sdUUID, exc_info=True)
+ 
+         self.status.update(self.nextStatus)
++
++    def _statusDidChange(self):
++        return (self.status.lastCheck == NOT_CHECKED_YET or
++                self.status.valid != self.nextStatus.valid)
+diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
+index d4c5dfc..a91ae92 100644
+--- a/vdsm/storage/hsm.py
++++ b/vdsm/storage/hsm.py
+@@ -1051,12 +1051,16 @@ class HSM:
+             pool = sp.StoragePool(spUUID, self.taskMng)
+             if not hostID or not scsiKey or not msdUUID or not masterVersion:
+                 hostID, scsiKey, msdUUID, masterVersion = pool.getPoolParams()
++
++            # Must register domain state change callbacks *before* connecting
++            # the pool, which starts domain monitor threads. Otherwise we will
++            # miss the first event from the monitor thread.
++            for cb in self.domainStateChangeCallbacks:
++                pool.domainMonitor.onDomainStateChange.register(cb)
++
+             res = pool.connect(hostID, scsiKey, msdUUID, masterVersion)
+             if res:
+                 self.pools[spUUID] = pool
+-                for callback in self.domainStateChangeCallbacks:
+-                    self.pools[spUUID].domainMonitor.\
+-                        onDomainStateChange.register(callback)
+             return res
+ 
+     @public
+diff --git a/vdsm/vm.py b/vdsm/vm.py
+index 22d7a2d..b9ab60b 100644
+--- a/vdsm/vm.py
++++ b/vdsm/vm.py
+@@ -2953,6 +2953,10 @@ class Vm(object):
+             else:
+                 devices = self.getConfDevices()
+ 
++            for drive in devices[DISK_DEVICES]:
++                if drive['device'] == 'disk' and isVdsmImage(drive):
++                    self.sdIds.append(drive['domainID'])
++
+         devMap = {DISK_DEVICES: Drive,
+                   NIC_DEVICES: NetworkInterfaceDevice,
+                   SOUND_DEVICES: SoundDevice,
+-- 
+1.8.4.2
+
diff --git a/0022-Revert-fix-premature-selinux-dependency.patch b/0022-Revert-fix-premature-selinux-dependency.patch
new file mode 100644
index 0000000..89deaa5
--- /dev/null
+++ b/0022-Revert-fix-premature-selinux-dependency.patch
@@ -0,0 +1,45 @@
+From c355df005001a3ed8e7b6b23467bb95bdc7fd199 Mon Sep 17 00:00:00 2001
+From: Dan Kenigsberg <danken at redhat.com>
+Date: Thu, 31 Oct 2013 13:03:37 +0000
+Subject: [PATCH 1/2] Revert "fix premature selinux dependency"
+
+This reverts commit 6193dbe36d4d5e17a4c5342193e7f20d0bc8bc04 as
+selinux-policy-3.7.19-195.el6_4.13 is out.
+
+Change-Id: Ie1a5225d9f3dde4fe7b394ed25408e29babc2f43
+Signed-off-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/20760
+Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Tested-by: Yaniv Bronhaim <ybronhei at redhat.com>
+---
+ vdsm.spec.in | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/vdsm.spec.in b/vdsm.spec.in
+index 08119d9..3296217 100644
+--- a/vdsm.spec.in
++++ b/vdsm.spec.in
+@@ -156,7 +156,7 @@ Requires: initscripts >= 9.03.31-2.el6_3.1
+ Requires: policycoreutils >= 2.0.83-19.30
+ Requires: policycoreutils-python >= 2.0.83-19.30
+ Requires: python-pthreading
+-Requires: selinux-policy-targeted >= 3.7.19-155
++Requires: selinux-policy-targeted >= 3.7.19-195.el6_4.13
+ Requires: lvm2 >= 2.02.95-10.el6_3.2
+ Requires: logrotate < 3.8.0
+ %endif
+@@ -657,11 +657,6 @@ if [ "$1" -eq 1 ] ; then
+     /sbin/chkconfig --add vdsmd
+     /sbin/chkconfig --add supervdsmd
+     /sbin/chkconfig --add vdsm-restore-net-config
+-
+-    # drop this ugly hack when selinux-policy-3.7.19-195.el6.13 is released
+-    /usr/sbin/semanage fcontext -a -s system_u -t virt_var_run_t -r s0 \
+-        '/var/run/vdsm(/.*)?'
+-    /sbin/restorecon /var/run/vdsm
+ fi
+ %else
+ %if 0%{?with_systemd}
+-- 
+1.8.4.2
+
diff --git a/0023-vdsm.spec-conditional-to-execute-semanage.patch b/0023-vdsm.spec-conditional-to-execute-semanage.patch
new file mode 100644
index 0000000..abff1df
--- /dev/null
+++ b/0023-vdsm.spec-conditional-to-execute-semanage.patch
@@ -0,0 +1,37 @@
+From 16e0b098ff5be2f25d8497a08b6fc2de6022610c Mon Sep 17 00:00:00 2001
+From: Douglas Schilling Landgraf <dougsland at redhat.com>
+Date: Thu, 28 Nov 2013 12:14:12 -0500
+Subject: [PATCH 2/2] vdsm.spec: conditional to execute semanage
+
+To avoid load policy when selinux is disabled, only
+execute semanage when selinux is enabled.
+
+Change-Id: I1d40e6d9dcaac16d74c685e4a6a6d5cb130ac531
+Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21830
+Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
+Tested-by: Yaniv Bronhaim <ybronhei at redhat.com>
+---
+ vdsm.spec.in | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/vdsm.spec.in b/vdsm.spec.in
+index 3296217..0bb73b1 100644
+--- a/vdsm.spec.in
++++ b/vdsm.spec.in
+@@ -649,8 +649,11 @@ if grep -q "# VDSM section begin" /etc/sysctl.conf; then
+ fi
+ 
+ # hack until we replace core dump with abrt
+-/usr/sbin/semanage fcontext -a -t virt_cache_t '/var/log/core(/.*)?'
++if /usr/sbin/selinuxenabled; then
++    /usr/sbin/semanage fcontext -a -t virt_cache_t '/var/log/core(/.*)?'
++fi
+ /sbin/restorecon -R -v /var/log/core
++# hack until we replace core dump with abrt
+ 
+ %if 0%{?rhel}
+ if [ "$1" -eq 1 ] ; then
+-- 
+1.8.4.2
+
diff --git a/0024-vdsm.spec-conditional-for-hostname-require.patch b/0024-vdsm.spec-conditional-for-hostname-require.patch
new file mode 100644
index 0000000..b3d0b30
--- /dev/null
+++ b/0024-vdsm.spec-conditional-for-hostname-require.patch
@@ -0,0 +1,124 @@
+From 16017316a84e25122e2f32c2732b46c8a5549a57 Mon Sep 17 00:00:00 2001
+From: Douglas Schilling Landgraf <dougsland at redhat.com>
+Date: Thu, 28 Nov 2013 09:35:20 -0500
+Subject: [PATCH] vdsm.spec: conditional for hostname require
+
+Fedora rawhide (F21) build is failing because cannot locate /bin/hostname.
+It has changed to /usr/bin/hostname as changelog from hostname 3.14-2.
+
+Koji info:
+http://koji.fedoraproject.org/koji/buildinfo?buildID=471302
+
+Change-Id: I865d1b84fe646932d3039b131bc236d36b8550ba
+Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/21194
+Reviewed-by: Bala.FA <barumuga 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/21840
+---
+ .gitignore                                   |  1 +
+ configure.ac                                 |  1 +
+ vdsm.spec.in                                 |  6 ++++++
+ vdsm/gluster/Makefile.am                     | 17 ++++++++++++++++-
+ vdsm/gluster/{hostname.py => hostname.py.in} |  6 +-----
+ 5 files changed, 25 insertions(+), 6 deletions(-)
+ rename vdsm/gluster/{hostname.py => hostname.py.in} (83%)
+
+diff --git a/configure.ac b/configure.ac
+index fac9755..52105e9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -199,6 +199,7 @@ AC_PATH_PROG([FENCE_AGENT_PATH], [fence_ilo], [/usr/sbin/fence_ilo])
+ AC_PATH_PROG([FUSER_PATH], [fuser], [/sbin/fuser])
+ AC_PATH_PROG([GREP_PATH], [grep], [/bin/grep])
+ AC_PATH_PROG([GRUBBY_PATH], [grubby], [/sbin/grubby])
++AC_PATH_PROG([HOSTNAME_PATH], [hostname], [/usr/bin/hostname])
+ AC_PATH_PROG([HWCLOCK_PATH], [hwclock], [/usr/sbin/hwclock])
+ AC_PATH_PROG([IFDOWN_PATH], [ifdown], [/sbin/ifdown])
+ AC_PATH_PROG([IFUP_PATH], [ifup], [/sbin/ifup])
+diff --git a/vdsm.spec.in b/vdsm.spec.in
+index 0bb73b1..00f8c70 100644
+--- a/vdsm.spec.in
++++ b/vdsm.spec.in
+@@ -220,7 +220,13 @@ Requires: %{name}-python = %{version}-%{release}
+ Requires: pyparted
+ 
+ Requires(post): /usr/sbin/saslpasswd2
++
++%if 0%{?fedora} && 0%{?fedora} >= 21
++Requires(post): hostname
++%else
+ Requires(post): /bin/hostname
++%endif
++
+ Requires(post): policycoreutils-python
+ Requires(preun): policycoreutils-python
+ 
+diff --git a/vdsm/gluster/Makefile.am b/vdsm/gluster/Makefile.am
+index dd5434d..ea36692 100644
+--- a/vdsm/gluster/Makefile.am
++++ b/vdsm/gluster/Makefile.am
+@@ -21,16 +21,31 @@
+ include $(top_srcdir)/build-aux/Makefile.subs
+ 
+ vdsmglusterdir = $(vdsmdir)/gluster
++
++nodist_vdsmgluster_PYTHON = \
++	hostname.py
++	$(NULL)
++
+ dist_vdsmgluster_PYTHON = \
+ 	__init__.py \
+ 	api.py \
+ 	cli.py \
+ 	exception.py \
+ 	hooks.py \
+-	hostname.py \
+ 	services.py \
+ 	$(NULL)
+ 
+ dist_vdsmgluster_DATA = \
+ 	vdsmapi-gluster-schema.json \
+ 	$(NULL)
++
++EXTRA_DIST = \
++	hostname.py.in
++	$(NULL)
++
++CLEANFILES = \
++	hostname.py
++	$(NULL)
++
++all-local: \
++	$(nodist_vdsmgluster_PYTHON)
+diff --git a/vdsm/gluster/hostname.py b/vdsm/gluster/hostname.py.in
+similarity index 83%
+rename from vdsm/gluster/hostname.py
+rename to vdsm/gluster/hostname.py.in
+index ffcf6c2..c817b0a 100644
+--- a/vdsm/gluster/hostname.py
++++ b/vdsm/gluster/hostname.py.in
+@@ -20,10 +20,6 @@
+ 
+ from vdsm import utils
+ 
+-_hostNameCommandPath = utils.CommandPath("hostname",
+-                                         "/bin/hostname",
+-                                         )
+-
+ 
+ class HostNameException(Exception):
+     def __init__(self, rc):
+@@ -35,7 +31,7 @@ class HostNameException(Exception):
+ 
+ 
+ def getHostNameFqdn():
+-    rc, out, err = utils.execCmd([_hostNameCommandPath.cmd, '--fqdn'])
++    rc, out, err = utils.execCmd(['@HOSTNAME_PATH@', '--fqdn'])
+     if rc:
+         raise HostNameException(rc)
+     else:
+-- 
+1.8.4.2
+
diff --git a/vdsm.spec b/vdsm.spec
index c54173a..a89ac5a 100644
--- a/vdsm.spec
+++ b/vdsm.spec
@@ -46,7 +46,7 @@
 
 Name:           %{vdsm_name}
 Version:        4.13.0
-Release:        13%{?dist}%{?extra_release}
+Release:        14%{?dist}%{?extra_release}
 Summary:        Virtual Desktop Server Manager
 
 Group:          Applications/System
@@ -60,6 +60,31 @@ Url:            http://www.ovirt.org/wiki/Vdsm
 #  ./autogen.sh --system
 #  make VERSION={version}-{vdsm_release} dist
 Source0:        %{vdsm_name}-%{version}%{?vdsm_relttag}.tar.gz
+# ovirt-3.3.2 patches
+Patch0:         0001-Invalidate-filters-on-HSMs-before-rescanning-extende.patch
+Patch1: 	0002-vm-refresh-raw-disk-before-live-extension.patch
+Patch2: 	0003-Renaming-etc-sysctl.d-vdsm-to-etc-sysctl.d-vdsm.conf.patch
+Patch3: 	0004-vm-unify-_highWrite-and-_onAbnormalStop.patch
+Patch4: 	0005-vm-prevent-faulty-volume-extensions.patch
+Patch5: 	0006-caps-coarse-grain-libvirt.rpm-may-be-missing.patch
+Patch6: 	0007-Report-qemu-kvm-rhev-if-installed.patch
+Patch7: 	0008-lvm-Allow-multiple-LVs-to-be-refreshed-at-once.patch
+Patch8:		0009-lvm-Deactivate-lvs-during-bootstrap.patch
+Patch9: 	0010-pep8-Fix-indentation-to-comply-with-pep8-1.3.3.patch
+Patch10: 	0011-Peform-related-services-restart-after-reconfiguring.patch
+Patch11: 	0012-vdsm-Accents-in-the-vm-name-break-the-migration.patch
+Patch12: 	0013-Ensure-cancellation-of-migrations-gets-handled-corre.patch
+Patch13: 	0014-Keeping-gluster-modules-when-with_gluster-set-to-0.patch
+Patch14: 	0015-Migration-cancellation-replies-wrong-message-format.patch
+Patch15:	0016-F20-netinfo-fix-linkShowDev-parsing-in-getVlanID.patch
+Patch16:	0017-fuserTests-fix-for-f20-and-arch.patch
+Patch17:	0018-Adding-debian-folder-makefile.patch
+Patch18:	0019-Fix-Makefile.am-in-debian-folder.patch
+Patch19: 	0020-Disable-exception-on-after-hooks-failures.patch
+Patch20: 	0021-vm-Fix-vm-unpausing-during-recovery.patch
+Patch21:	0022-Revert-fix-premature-selinux-dependency.patch
+Patch22: 	0023-vdsm.spec-conditional-to-execute-semanage.patch
+Patch23: 	0024-vdsm.spec-conditional-for-hostname-require.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -170,7 +195,7 @@ Requires: initscripts >= 9.03.31-2.el6_3.1
 Requires: policycoreutils >= 2.0.83-19.30
 Requires: policycoreutils-python >= 2.0.83-19.30
 Requires: python-pthreading
-Requires: selinux-policy-targeted >= 3.7.19-155
+Requires: selinux-policy-targeted >= 3.7.19-195.el6_4.13
 Requires: lvm2 >= 2.02.95-10.el6_3.2
 Requires: logrotate < 3.8.0
 %endif
@@ -560,6 +585,32 @@ Gluster plugin enables VDSM to serve Gluster functionalities.
 
 %prep
 %setup -q
+# ovirt-3.3.2 patches
+%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
+
 %if 0%{?rhel} == 6
 sed -i '/ su /d' vdsm/vdsm-logrotate.conf.in
 %endif
@@ -663,7 +714,7 @@ export LC_ALL=C
 # set the vdsm "secret" password for libvirt
 %{_bindir}/vdsm-tool set-saslpasswd
 
-# Have moved vdsm section in /etc/sysctl.conf to /etc/sysctl.d/vdsm.
+# Have moved vdsm section in /etc/sysctl.conf to /etc/sysctl.d/vdsm.conf.
 # So Remove them if it is played with /etc/sysctl.conf.
 if grep -q "# VDSM section begin" /etc/sysctl.conf; then
     /bin/sed -i '/# VDSM section begin/,/# VDSM section end/d' \
@@ -671,19 +722,17 @@ if grep -q "# VDSM section begin" /etc/sysctl.conf; then
 fi
 
 # hack until we replace core dump with abrt
-/usr/sbin/semanage fcontext -a -t virt_cache_t '/var/log/core(/.*)?'
+if /usr/sbin/selinuxenabled; then
+    /usr/sbin/semanage fcontext -a -t virt_cache_t '/var/log/core(/.*)?'
+fi
 /sbin/restorecon -R -v /var/log/core
+# hack until we replace core dump with abrt
 
 %if 0%{?rhel}
 if [ "$1" -eq 1 ] ; then
     /sbin/chkconfig --add vdsmd
     /sbin/chkconfig --add supervdsmd
     /sbin/chkconfig --add vdsm-restore-net-config
-
-    # drop this ugly hack when selinux-policy-3.7.19-195.el6.13 is released
-    /usr/sbin/semanage fcontext -a -s system_u -t virt_var_run_t -r s0 \
-        '/var/run/vdsm(/.*)?'
-    /sbin/restorecon /var/run/vdsm
 fi
 %else
 %if 0%{?with_systemd}
@@ -770,11 +819,9 @@ if [ "$1" -ge 1 ]; then
         %{_bindir}/vdsm-tool service-stop supervdsmd >/dev/null 2>&1
         supervdsmd_start_required='yes'
     fi
-    if %{_bindir}/vdsm-tool libvirt-configure | grep -q 'is done.'; then
-        if %{_bindir}/vdsm-tool service-status libvirtd >/dev/null 2>&1; then
-            %{_bindir}/vdsm-tool service-restart libvirtd >/dev/null 2>&1
-        fi
-    fi
+
+    %{_bindir}/vdsm-tool libvirt-configure >/dev/null 2>&1
+
     if [ "${supervdsmd_start_required}" = 'yes' ]; then
         %{_bindir}/vdsm-tool service-start supervdsmd >/dev/null 2>&1
     fi
@@ -886,7 +933,7 @@ exit 0
 %config(noreplace) %{_sysconfdir}/%{vdsm_name}/mom.d/*.policy
 %config(noreplace) %{_sysconfdir}/logrotate.d/vdsm
 %config(noreplace) %{_sysconfdir}/rwtab.d/vdsm
-%config(noreplace) %{_sysconfdir}/sysctl.d/vdsm
+%config(noreplace) %{_sysconfdir}/sysctl.d/vdsm.conf
 %if 0%{?with_systemd}
 %config(noreplace) %{_sysconfdir}/modules-load.d/vdsm.conf
 %endif
@@ -917,12 +964,8 @@ exit 0
 %{_datadir}/%{vdsm_name}/storage/fileUtils.py*
 %{_datadir}/%{vdsm_name}/storage/fileVolume.py*
 %{_datadir}/%{vdsm_name}/storage/fuser.py*
-%if 0%{?with_gluster}
 %{_datadir}/%{vdsm_name}/storage/glusterSD.py*
 %{_datadir}/%{vdsm_name}/storage/glusterVolume.py*
-%else
-%exclude %{_datadir}/%{vdsm_name}/storage/gluster*
-%endif
 %{_datadir}/%{vdsm_name}/storage/hba.py*
 %{_datadir}/%{vdsm_name}/storage/hsm.py*
 %{_datadir}/%{vdsm_name}/storage/image.py*
@@ -1108,14 +1151,10 @@ exit 0
 %{_datadir}/%{vdsm_name}/tests/netmaskconversions
 %{_datadir}/%{vdsm_name}/tests/run_tests.sh
 %{_datadir}/%{vdsm_name}/tests/tc_filter_show.out
-%if 0%{?with_gluster}
 %{_datadir}/%{vdsm_name}/tests/glusterVolumeProfileInfo.xml
 %{_datadir}/%{vdsm_name}/tests/glusterVolumeProfileInfoNfs.xml
 %{_datadir}/%{vdsm_name}/tests/glusterVolumeRebalanceStatus.xml
 %{_datadir}/%{vdsm_name}/tests/glusterVolumeRemoveBricksStatus.xml
-%else
-%exclude %{_datadir}/%{vdsm_name}/tests/gluster*
-%endif
 %{_datadir}/%{vdsm_name}/tests/functional/*.py*
 %{_datadir}/%{vdsm_name}/tests/functional/*.policy
 
@@ -1336,11 +1375,10 @@ exit 0
 %attr(755, root, root) %{python_sitearch}/cpopen/cpopen.so*
 
 %changelog
-* Tue Nov 19 2013 Douglas Schilling Landgraf <dougsland at redhat.com> - 4.13.0-13
-- remove duplicate require hostname
-
-* Wed Nov 13 2013 Douglas Schilling Landgraf <dougsland at redhat.com> - 4.13.0-12
-- Update spec to fit a new validation for hostname requires.
+* Thu Nov 28 2013 Yaniv Bronhaim <ybronhei at redhat.com> - 4.13.0-14
+- Adding update patches from branch ovirt-3.3
+- Declaring ovirt-3.3.2 patchsets scope in spec which declares all the merged
+new patches
 
 * Tue Nov 12 2013 Douglas Schilling Landgraf <dougsland at redhat.com> - 4.13.0-11
 - update from branch ovirt-3.3 which include:


More information about the scm-commits mailing list