From fe5111499f0f7c07add19ac7fdb1fd80045865b1 Mon Sep 17 00:00:00 2001 From: Federico Simoncelli Date: Jul 25 2013 07:39:17 +0000 Subject: update to vdsm-4.12.0-rc3 --- diff --git a/0001-build-use-pythondir-for-vdsmapi.patch b/0001-build-use-pythondir-for-vdsmapi.patch new file mode 100644 index 0000000..392aac6 --- /dev/null +++ b/0001-build-use-pythondir-for-vdsmapi.patch @@ -0,0 +1,41 @@ +From 69c86e0adc6974d6170ab7297dc4ea1688bdfe8a Mon Sep 17 00:00:00 2001 +From: Federico Simoncelli +Date: Tue, 23 Jul 2013 08:36:23 -0400 +Subject: [PATCH] build: use pythondir for vdsmapi + +Change-Id: I8077efea03adb7d018c35cfd81b121b9e47d3e98 +Signed-off-by: Federico Simoncelli +--- + vdsm.spec.in | 2 +- + vdsm_api/Makefile.am | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/vdsm.spec.in b/vdsm.spec.in +index 9b02677..608735a 100644 +--- a/vdsm.spec.in ++++ b/vdsm.spec.in +@@ -1208,7 +1208,7 @@ exit 0 + %files api + %doc vdsm_api/vdsm-api.html + %{_datadir}/%{vdsm_name}/vdsmapi-schema.json +-%{python_sitearch}/vdsmapi.py* ++%{python_sitelib}/vdsmapi.py* + + %files jsonrpc + %{_datadir}/%{vdsm_name}/BindingJsonRpc.py* +diff --git a/vdsm_api/Makefile.am b/vdsm_api/Makefile.am +index 0a9e610..8331dea 100644 +--- a/vdsm_api/Makefile.am ++++ b/vdsm_api/Makefile.am +@@ -16,7 +16,7 @@ dist_vdsm_DATA = \ + vdsmapi-schema.json \ + $(NULL) + +-dist_pyexec_PYTHON = \ ++dist_python_PYTHON = \ + vdsmapi.py \ + $(NULL) + +-- +1.7.1 + diff --git a/0001-schema-Fix-schema-for-VM.updateDevice.patch b/0001-schema-Fix-schema-for-VM.updateDevice.patch deleted file mode 100644 index 59cd4bc..0000000 --- a/0001-schema-Fix-schema-for-VM.updateDevice.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 844f10a9aafd55018e9966a61dece726d3e62511 Mon Sep 17 00:00:00 2001 -From: Adam Litke -Date: Wed, 12 Dec 2012 13:52:19 -0600 -Subject: [PATCH 1/3] schema: Fix schema for VM.updateDevice - -Another recent update broke the schema file. I'll take the blame for this one -since I approved the change :) Some missing and/or malformed data in comments -was causing the process-schema script to fail. Another reason for validating -the schema during the build. - -Change-Id: If88596050ace9511bcc7be65ee46645359e30532 -Signed-off-by: Adam Litke -Reviewed-on: http://gerrit.ovirt.org/10012 -Reviewed-by: Saggi Mizrahi -Tested-by: Saggi Mizrahi -Reviewed-on: http://gerrit.ovirt.org/10019 -Reviewed-by: Dan Kenigsberg -Tested-by: Antoni Segura Puimedon ---- - vdsm_api/vdsmapi-schema.json | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json -index 9772e18..487e69a 100644 ---- a/vdsm_api/vdsmapi-schema.json -+++ b/vdsm_api/vdsmapi-schema.json -@@ -4894,10 +4894,12 @@ - ## - # @vmUpdateDeviceParams: - # -+# A discriminated record of update parameters for a VM device. -+# - # @deviceType: The VM device type to update. For example 'interface' for - # network devices or 'disk' for disk storage devices. - # --# Since 4.10.3 -+# Since: 4.10.3 - ## - {'type': 'vmUpdateDeviceParams', - 'data': {'deviceType': 'VmDeviceType'}, -@@ -4924,11 +4926,11 @@ - # by alias. If omitted, it keeps the current mirroring - # configuration. - # --# Since 4.10.3 -+# Since: 4.10.3 - ## - {'type': 'vmUpdateInterfaceDeviceParams', - 'data': {'*network': 'str', '*linkActive': 'bool', -- 'alias': 'str', '*portMirroring': '[str]'}} -+ 'alias': 'str', '*portMirroring': ['str']}} - - ## - # @VM.updateDevice: -@@ -4943,7 +4945,6 @@ - # The VM definition, as updated - # - # Since: 4.10.3 --# - ## - {'command': {'class': 'VM', 'name': 'updateDevice'}, - 'data': {'vmId': 'UUID', 'params': 'vmUpdateDeviceParams'}, --- -1.7.11.7 - diff --git a/0002-schema-Missing-comment-for-new-VmDeviceType.patch b/0002-schema-Missing-comment-for-new-VmDeviceType.patch deleted file mode 100644 index d44579b..0000000 --- a/0002-schema-Missing-comment-for-new-VmDeviceType.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 244713456b87d4ea1873c98cbaae52bffd3ce1ee Mon Sep 17 00:00:00 2001 -From: Adam Litke -Date: Wed, 12 Dec 2012 14:11:16 -0600 -Subject: [PATCH 2/3] schema: Missing comment for new VmDeviceType - -When adding a new 'console' VmDeviceType, the submitter forgot to include -documentation in the comment block. This caused process-schema.py to fail. - -Change-Id: Icd7db71a4cd1a2addd31815a73dcd5c1cda7af4f -Signed-off-by: Adam Litke -Reviewed-on: http://gerrit.ovirt.org/10013 -Reviewed-by: Saggi Mizrahi -Tested-by: Saggi Mizrahi -Reviewed-on: http://gerrit.ovirt.org/10020 -Reviewed-by: Dan Kenigsberg -Tested-by: Dan Kenigsberg ---- - vdsm_api/vdsmapi-schema.json | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json -index 487e69a..58dd6e2 100644 ---- a/vdsm_api/vdsmapi-schema.json -+++ b/vdsm_api/vdsmapi-schema.json -@@ -1681,6 +1681,8 @@ - # - # @channel: A host-guest communication channel - # -+# @console: A console device -+# - # Since: 4.10.0 - ## - {'enum': 'VmDeviceType', --- -1.7.11.7 - diff --git a/0003-api-Report-CPU-thread-info-in-getVdsCapabilities.patch b/0003-api-Report-CPU-thread-info-in-getVdsCapabilities.patch deleted file mode 100644 index e502d73..0000000 --- a/0003-api-Report-CPU-thread-info-in-getVdsCapabilities.patch +++ /dev/null @@ -1,53 +0,0 @@ -From b8c1c973d9767859d144042531f7a5ae76fce389 Mon Sep 17 00:00:00 2001 -From: Greg Padgett -Date: Thu, 20 Dec 2012 09:43:29 -0500 -Subject: [PATCH 3/3] api: Report CPU thread info in getVdsCapabilities - -Report CPU thread info in getVdsCapabilities - -Change-Id: I11f1e139a3f3d5bd18032713694bdebf9ab8c1d7 -Signed-off-by: Greg Padgett -Reviewed-on: http://gerrit.ovirt.org/10300 -Reviewed-by: Federico Simoncelli ---- - vdsm/caps.py | 1 + - vdsm_api/vdsmapi-schema.json | 4 +++- - 2 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/vdsm/caps.py b/vdsm/caps.py -index 0438fb4..6749227 100644 ---- a/vdsm/caps.py -+++ b/vdsm/caps.py -@@ -261,6 +261,7 @@ def get(): - else: - caps['cpuCores'] = str(cpuTopology.cores()) - -+ caps['cpuThreads'] = str(cpuTopology.threads()) - caps['cpuSockets'] = str(cpuTopology.sockets()) - caps['cpuSpeed'] = cpuInfo.mhz() - if config.getboolean('vars', 'fake_kvm_support'): -diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json -index 58dd6e2..c72ec4b 100644 ---- a/vdsm_api/vdsmapi-schema.json -+++ b/vdsm_api/vdsmapi-schema.json -@@ -848,6 +848,8 @@ - # - # @kvmEnabled: KVM is enabled on the host - # -+# @cpuThreads: The number of CPU threads present -+# - # @cpuCores: The number of CPU cores present - # - # @cpuSockets: The numbet of CPU sockets -@@ -909,7 +911,7 @@ - # the current API truncates @software_version to 'x.y'. - ## - {'type': 'VdsmCapabilities', -- 'data': {'kvmEnabled': 'bool', 'cpuCores': 'uint', -+ 'data': {'kvmEnabled': 'bool', 'cpuThreads': 'uint', 'cpuCores': 'uint', - 'cpuSockets': 'uint', 'cpuSpeed': 'float', 'cpuModel': 'str', - 'cpuFlags': 'str', 'version_name': 'str', 'software_version': 'str', - 'software_revision': 'str', 'supportedENGINEs': ['str'], --- -1.7.11.7 - diff --git a/0004-caps.py-osversion-validate-OVIRT.patch b/0004-caps.py-osversion-validate-OVIRT.patch deleted file mode 100644 index 9333042..0000000 --- a/0004-caps.py-osversion-validate-OVIRT.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 95be2057db1bea2730bc4b65058f5b1a42ab45bd Mon Sep 17 00:00:00 2001 -From: Douglas Schilling Landgraf -Date: Mon, 17 Dec 2012 19:23:21 -0500 -Subject: [PATCH 4/6] caps.py: osversion() validate OVIRT - -Currently we are only validating RHEV-H node. -This patch will validate oVirt node as well in osversion(). - -Change-Id: I58efd4660f94b2f68ead470a54f0f301a1b9b4ba -Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=873917 -Signed-off-by: Douglas Schilling Landgraf -Reviewed-on: http://gerrit.ovirt.org/10177 -Reviewed-by: Alon Bar-Lev -Tested-by: Alon Bar-Lev -Reviewed-by: Dan Kenigsberg ---- - vdsm/caps.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/vdsm/caps.py b/vdsm/caps.py -index 6749227..e9a1476 100644 ---- a/vdsm/caps.py -+++ b/vdsm/caps.py -@@ -229,7 +229,7 @@ def osversion(): - - osname = getos() - try: -- if osname == OSName.RHEVH: -+ if osname == OSName.RHEVH or osname == OSName.OVIRT: - d = _parseKeyVal(file('/etc/default/version')) - version = d.get('VERSION', '') - release = d.get('RELEASE', '') --- -1.7.11.7 - diff --git a/0005-restarting-libvirtd-didn-t-work-over-allinone-setup.patch b/0005-restarting-libvirtd-didn-t-work-over-allinone-setup.patch deleted file mode 100644 index bc7af92..0000000 --- a/0005-restarting-libvirtd-didn-t-work-over-allinone-setup.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 87dfb384debe7c171c3df27f13dc95ba3f0f0d5b Mon Sep 17 00:00:00 2001 -From: Yaniv Bronhaim -Date: Sun, 23 Dec 2012 10:40:29 +0200 -Subject: [PATCH 5/6] restarting libvirtd didn't work over allinone setup - -Change-Id: I300adc5ac3d9b12fee49023a54e5ffb4dee98da1 -Bug-Id: https://bugzilla.redhat.com/show_bug.cgi?id=888258 -Signed-off-by: Yaniv Bronhaim -Reviewed-on: http://gerrit.ovirt.org/10237 -Tested-by: Ohad Basan -Reviewed-by: Ohad Basan -Reviewed-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/10316 ---- - vdsm/vdsmd.init.in | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/vdsm/vdsmd.init.in b/vdsm/vdsmd.init.in -index 7a7ae84..c8223d3 100755 ---- a/vdsm/vdsmd.init.in -+++ b/vdsm/vdsmd.init.in -@@ -362,7 +362,11 @@ EOF - - ovirt_store_config "$lconf" "$qconf" "$ldconf" "$llogr" - -- /sbin/initctl restart libvirtd 2>/dev/null || : -+ if libvirt_should_use_upstart; then -+ /sbin/initctl restart libvirtd 2>/dev/null || : -+ else -+ /bin/systemctl restart libvirtd.service -+ fi - - # - # finished reconfiguration, do not trigger --- -1.7.11.7 - diff --git a/0006-Integrate-Smartcard-support.patch b/0006-Integrate-Smartcard-support.patch deleted file mode 100644 index 7837b0e..0000000 --- a/0006-Integrate-Smartcard-support.patch +++ /dev/null @@ -1,421 +0,0 @@ -From d33da223da1160b1ad2a8d02316b6b435bee9c29 Mon Sep 17 00:00:00 2001 -From: Tomas Jelinek -Date: Wed, 10 Oct 2012 03:06:21 -0400 -Subject: [PATCH 6/6] Integrate Smartcard support - -This patch is a VDSM part of the integrating -the smartcard support to the ovirt: - -This VDSM part integrates the smartcard in -a supported way, not just as an unsupported custom hook. - -It also removes the smartcard hook itself. - -Change-Id: I7cdaef420c8381d588f6215e66e6a80dd9d2e44b -Signed-off-by: Tomas Jelinek -Signed-off-by: Peter V. Saveliev -Signed-off-by: Antoni S. Puimedon -Reviewed-on: http://gerrit.ovirt.org/10547 -Tested-by: Omer Frenkel -Reviewed-by: Dan Kenigsberg -Reviewed-by: Federico Simoncelli ---- - configure.ac | 1 - - tests/libvirtvmTests.py | 7 +++++ - vdsm.spec.in | 12 -------- - vdsm/libvirtvm.py | 44 ++++++++++++++++++++++++++++- - vdsm/vm.py | 19 +++++++++++-- - vdsm_api/vdsmapi-schema.json | 49 +++++++++++++++++++++++++++++++-- - vdsm_hooks/Makefile.am | 1 - - vdsm_hooks/README | 4 +-- - vdsm_hooks/smartcard/Makefile.am | 18 ------------ - vdsm_hooks/smartcard/README | 9 ------ - vdsm_hooks/smartcard/before_vm_start.py | 29 ------------------- - 11 files changed, 116 insertions(+), 77 deletions(-) - delete mode 100644 vdsm_hooks/smartcard/Makefile.am - delete mode 100644 vdsm_hooks/smartcard/README - delete mode 100755 vdsm_hooks/smartcard/before_vm_start.py - -diff --git a/configure.ac b/configure.ac -index a6265b5..3489e38 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -209,7 +209,6 @@ AC_OUTPUT([ - vdsm_hooks/qos/Makefile - vdsm_hooks/qemucmdline/Makefile - vdsm_hooks/scratchpad/Makefile -- vdsm_hooks/smartcard/Makefile - vdsm_hooks/smbios/Makefile - vdsm_hooks/sriov/Makefile - vdsm_hooks/vhostmd/Makefile -diff --git a/tests/libvirtvmTests.py b/tests/libvirtvmTests.py -index 4ed7318..bd68f2a 100644 ---- a/tests/libvirtvmTests.py -+++ b/tests/libvirtvmTests.py -@@ -91,6 +91,13 @@ class TestLibvirtvm(TestCaseBase): - domxml.appendOs() - self.assertXML(domxml.dom, xml, 'os') - -+ def testSmartcardXML(self): -+ smartcardXML = '' -+ dev = {'device': 'smartcard', -+ 'specParams': {'mode': 'passthrough', 'type': 'spicevmc'}} -+ smartcard = libvirtvm.SmartCardDevice(self.conf, self.log, **dev) -+ self.assertXML(smartcard.getXML(), smartcardXML) -+ - def testFeaturesXML(self): - featuresXML = """ - -diff --git a/vdsm.spec.in b/vdsm.spec.in -index 1978fa9..f9e238b 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -353,14 +353,6 @@ Hook creates a disk for a VM onetime usage, - the disk will be erased when the VM destroyed. - VM cannot be migrated when using scratchpad hook - --%package hook-smartcard --Summary: Smartcard support for Spice protocol in VDSM --BuildArch: noarch -- --%description hook-smartcard --Smartcard hook add support for spice in VDSM. --Smartcard hook enable user to use its smartcard inside virtual machines. -- - %package hook-smbios - Summary: Adding custom smbios entries to libvirt domain via VDSM - BuildArch: noarch -@@ -887,10 +879,6 @@ exit 0 - %{_libexecdir}/%{vdsm_name}/hooks/before_vm_migrate_source/50_scratchpad - %{_libexecdir}/%{vdsm_name}/hooks/after_vm_destroy/50_scratchpad - --%files hook-smartcard --%defattr(-, root, root, -) --%{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/50_smartcard -- - %files hook-smbios - %defattr(-, root, root, -) - %{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/50_smbios -diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py -index 219e382..fe140ec 100644 ---- a/vdsm/libvirtvm.py -+++ b/vdsm/libvirtvm.py -@@ -1243,6 +1243,21 @@ class WatchdogDevice(LibvirtVmDevice): - return m - - -+class SmartCardDevice(LibvirtVmDevice): -+ def getXML(self): -+ """ -+ Add smartcard section to domain xml -+ -+ -+
-+ -+ """ -+ card = self.createXmlElem(self.device, None, ['address']) -+ card.setAttribute('mode', self.specParams['mode']) -+ card.setAttribute('type', self.specParams['type']) -+ return card -+ -+ - class RedirDevice(LibvirtVmDevice): - def getXML(self): - """ -@@ -1395,6 +1410,7 @@ class LibvirtVm(vm.Vm): - self._getUnderlyingControllerDeviceInfo() - self._getUnderlyingBalloonDeviceInfo() - self._getUnderlyingWatchdogDeviceInfo() -+ self._getUnderlyingSmartcardDeviceInfo() - # Obtain info of all unknown devices. Must be last! - self._getUnderlyingUnknownDeviceInfo() - -@@ -1486,7 +1502,8 @@ class LibvirtVm(vm.Vm): - vm.BALLOON_DEVICES: BalloonDevice, - vm.WATCHDOG_DEVICES: WatchdogDevice, - vm.REDIR_DEVICES: RedirDevice, -- vm.CONSOLE_DEVICES: ConsoleDevice} -+ vm.CONSOLE_DEVICES: ConsoleDevice, -+ vm.SMARTCARD_DEVICES: SmartCardDevice} - - for devType, devClass in devMap.items(): - for dev in devices[devType]: -@@ -2800,6 +2817,31 @@ class LibvirtVm(vm.Vm): - dev['address'] = address - dev['alias'] = alias - -+ def _getUnderlyingSmartcardDeviceInfo(self): -+ """ -+ Obtain smartcard device info from libvirt. -+ """ -+ smartcardxml = _domParseStr(self._lastXMLDesc).childNodes[0].\ -+ getElementsByTagName('devices')[0].\ -+ getElementsByTagName('smartcard') -+ for x in smartcardxml: -+ if not x.getElementsByTagName('address'): -+ continue -+ -+ address = self._getUnderlyingDeviceAddress(x) -+ alias = x.getElementsByTagName('alias')[0].getAttribute('name') -+ -+ for dev in self._devices[vm.SMARTCARD_DEVICES]: -+ if not hasattr(dev, 'address'): -+ dev.address = address -+ dev.alias = alias -+ -+ for dev in self.conf['devices']: -+ if dev['device'] == vm.SMARTCARD_DEVICES and \ -+ not dev.get('address'): -+ dev['address'] = address -+ dev['alias'] = alias -+ - def _getUnderlyingWatchdogDeviceInfo(self): - """ - Obtain watchdog device info from libvirt. -diff --git a/vdsm/vm.py b/vdsm/vm.py -index 49fcb11..9610644 100644 ---- a/vdsm/vm.py -+++ b/vdsm/vm.py -@@ -47,6 +47,7 @@ BALLOON_DEVICES = 'balloon' - REDIR_DEVICES = 'redir' - WATCHDOG_DEVICES = 'watchdog' - CONSOLE_DEVICES = 'console' -+SMARTCARD_DEVICES = 'smartcard' - - """ - A module containing classes needed for VM communication. -@@ -364,7 +365,8 @@ class Vm(object): - SOUND_DEVICES: [], VIDEO_DEVICES: [], - CONTROLLER_DEVICES: [], GENERAL_DEVICES: [], - BALLOON_DEVICES: [], REDIR_DEVICES: [], -- WATCHDOG_DEVICES: [], CONSOLE_DEVICES: []} -+ WATCHDOG_DEVICES: [], CONSOLE_DEVICES: [], -+ SMARTCARD_DEVICES: []} - - def _get_lastStatus(self): - PAUSED_STATES = ('Powering down', 'RebootInProgress', 'Up') -@@ -447,7 +449,8 @@ class Vm(object): - SOUND_DEVICES: [], VIDEO_DEVICES: [], - CONTROLLER_DEVICES: [], GENERAL_DEVICES: [], - BALLOON_DEVICES: [], REDIR_DEVICES: [], -- WATCHDOG_DEVICES: [], CONSOLE_DEVICES: []} -+ WATCHDOG_DEVICES: [], CONSOLE_DEVICES: [], -+ SMARTCARD_DEVICES: []} - for dev in self.conf.get('devices'): - try: - devices[dev['type']].append(dev) -@@ -485,6 +488,7 @@ class Vm(object): - devices[GENERAL_DEVICES] = [] - devices[BALLOON_DEVICES] = [] - devices[WATCHDOG_DEVICES] = [] -+ devices[SMARTCARD_DEVICES] = self.getConfSmartcard() - devices[REDIR_DEVICES] = [] - devices[CONSOLE_DEVICES] = [] - else: -@@ -549,6 +553,17 @@ class Vm(object): - - return vcards - -+ def getConfSmartcard(self): -+ """ -+ Normalize smartcard device (now there is only one) -+ """ -+ cards = [] -+ if self.conf.get('smartcard'): -+ cards.append({'device': SMARTCARD_DEVICES, -+ 'specParams': {'mode': 'passthrough', -+ 'type': 'spicevmc'}}) -+ return cards -+ - def getConfSound(self): - """ - Normalize sound device provided by conf. -diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json -index c72ec4b..7c9ef22 100644 ---- a/vdsm_api/vdsmapi-schema.json -+++ b/vdsm_api/vdsmapi-schema.json -@@ -1685,11 +1685,13 @@ - # - # @console: A console device - # -+# @smartcard: A smartcard device -+# - # Since: 4.10.0 - ## - {'enum': 'VmDeviceType', - 'data': ['disk', 'interface', 'video', 'sound', 'controller', 'balloon', -- 'channel', 'console']} -+ 'channel', 'console', 'smartcard']} - - ## - # @VmDiskDeviceType: -@@ -2356,6 +2358,48 @@ - 'address': 'VmDeviceAddress', 'alias': 'str', 'deviceId': 'UUID'}} - - ## -+# @VmSmartcardDeviceSpecParams: -+# -+# Additional VM smartcard device parameters. -+# -+# Since: 4.10.3 -+## -+{'type': 'VmSmartcardDeviceSpecParams', 'data': {}} -+ -+## -+# @VmSmartcardDeviceType: -+# -+# An enumeration of VM smartcard device types. -+# -+# @smartcard: A smartcard -+# -+# Since: 4.10.3 -+## -+{'enum': 'VmSmartcardDeviceType', 'data': ['smartcard']} -+ -+## -+# @VmSmartcardDevice: -+# -+# Properties of a VM smartcard device. -+# -+# @deviceType: The device type (always @smartcard) -+# -+# @device: The the type of smartcard device -+# -+# @address: Device hardware address -+# -+# @alias: Alias used to identify this device in commands -+# -+# @specParams: #optional Additional device parameters -+# -+# Since: 4.10.3 -+## -+{'type': 'VmSmartcardDevice', -+ 'data': {'deviceType': 'VmDeviceType', 'device': 'VmSmartcardDeviceType', -+ 'address': 'VmDeviceAddress', 'alias': 'str', -+ '*specParams': 'VmSmartcardDeviceSpecParams'}} -+ -+## - # @VmConsoleDevice: - # - # Properties of a VM console device. -@@ -2382,7 +2426,8 @@ - 'data': {'deviceType': 'VmDeviceType',}, - 'union': ['VmDiskDevice', 'VmInterfaceDevice', 'VmVideoDevice', - 'VmSoundDevice', 'VmControllerDevice', 'VmBalloonDevice', -- 'VmChannelDevice', 'VmWatchdogDevice', 'VmConsoleDevice']} -+ 'VmChannelDevice', 'VmWatchdogDevice', 'VmConsoleDevice', -+ 'VmSmartcardDevice']} - - ## - # @VmShortStatus: -diff --git a/vdsm_hooks/Makefile.am b/vdsm_hooks/Makefile.am -index 9f00d4d..0e27a98 100644 ---- a/vdsm_hooks/Makefile.am -+++ b/vdsm_hooks/Makefile.am -@@ -37,7 +37,6 @@ SUBDIRS += \ - promisc \ - qos \ - scratchpad \ -- smartcard \ - smbios \ - sriov \ - vmdisk \ -diff --git a/vdsm_hooks/README b/vdsm_hooks/README -index b45b93e..1659610 100644 ---- a/vdsm_hooks/README -+++ b/vdsm_hooks/README -@@ -24,7 +24,7 @@ To work with VDSM hooks you need first to do the following: - - If you want to enable more then one custom hook use the semicolon as - a separator: -- # rhevm-config -s UserDefinedVMProperties='pincpu=^[0-9]+$;smartcard=^(true|false)$' --cver=3.0 -+ # rhevm-config -s UserDefinedVMProperties='pincpu=^[0-9]+$;sap_agent=^(true|false)$' --cver=3.0 - - The convention is [hook name]=[value], the value is evaluate with regular expression, - If you find regular expression too complex, you can always use the following command: -@@ -47,7 +47,7 @@ To work with VDSM hooks you need first to do the following: - pincpu=1 - if you want to use more then on hook and you did enable it with the rhevm-config - tool, you can use the semicolon as a separator: -- pincpu=1;smartcard=true -+ pincpu=1;sap_agent=true - b. Another option is to use "Run Once" dialog which mean that you add a custom property - only this time to the VM, next time that you run the VM it will run without the - custom property that you provided. -diff --git a/vdsm_hooks/smartcard/Makefile.am b/vdsm_hooks/smartcard/Makefile.am -deleted file mode 100644 -index dfefff5..0000000 ---- a/vdsm_hooks/smartcard/Makefile.am -+++ /dev/null -@@ -1,18 +0,0 @@ --# Copyright 2008 Red Hat, Inc. and/or its affiliates. --# --# Licensed to you under 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. See the files README and --# LICENSE_GPL_v2 which accompany this distribution. --# -- --EXTRA_DIST = \ -- before_vm_start.py -- --install-data-local: -- $(MKDIR_P) $(DESTDIR)$(vdsmhooksdir)/before_vm_start -- $(INSTALL_SCRIPT) $(srcdir)/before_vm_start.py \ -- $(DESTDIR)$(vdsmhooksdir)/before_vm_start/50_smartcard -- --uninstall-local: -- $(RM) $(DESTDIR)$(vdsmhooksdir)/before_vm_start/50_smartcard -diff --git a/vdsm_hooks/smartcard/README b/vdsm_hooks/smartcard/README -deleted file mode 100644 -index bd376bf..0000000 ---- a/vdsm_hooks/smartcard/README -+++ /dev/null -@@ -1,9 +0,0 @@ --smartcard hook: --=============== --add smartcard support for spice -- --syntax: --smartcard: smartcard=true -- --libvirt xml: -- -diff --git a/vdsm_hooks/smartcard/before_vm_start.py b/vdsm_hooks/smartcard/before_vm_start.py -deleted file mode 100755 -index 1944978..0000000 ---- a/vdsm_hooks/smartcard/before_vm_start.py -+++ /dev/null -@@ -1,29 +0,0 @@ --#!/usr/bin/python -- --import os --import sys --import hooking --import traceback -- --''' --smartcard vdsm hook --adding to domain xml -- --''' -- --if 'smartcard' in os.environ: -- try: -- sys.stderr.write('smartcard: adding smartcard support\n') -- domxml = hooking.read_domxml() -- -- devices = domxml.getElementsByTagName('devices')[0] -- card = domxml.createElement('smartcard') -- card.setAttribute('mode', 'passthrough') -- card.setAttribute('type', 'spicevmc') -- -- devices.appendChild(card) -- -- hooking.write_domxml(domxml) -- except: -- sys.stderr.write('smartcard: [unexpected error]: %s\n' % traceback.format_exc()) -- sys.exit(2) --- -1.7.11.7 - diff --git a/0007-vdsm.spec-python-ordereddict-only-for-rhel-7.patch b/0007-vdsm.spec-python-ordereddict-only-for-rhel-7.patch deleted file mode 100644 index d20a3c9..0000000 --- a/0007-vdsm.spec-python-ordereddict-only-for-rhel-7.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 03389bcfa0808927ad7e8115073f89f05ce7fe5b Mon Sep 17 00:00:00 2001 -From: Douglas Schilling Landgraf -Date: Tue, 15 Jan 2013 13:12:08 -0500 -Subject: [PATCH 07/22] vdsm.spec: python-ordereddict only for rhel < 7 - -rhel7 contains python 2.7 which already includes ordereddict module, -no need extra python package. - -Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=891542 -Change-Id: I784d82a7fb5a1c6a13f015747f077020b91c19cb -Signed-off-by: Douglas Schilling Landgraf -Reviewed-on: http://gerrit.ovirt.org/11056 -Reviewed-by: Dan Kenigsberg ---- - vdsm.spec.in | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/vdsm.spec.in b/vdsm.spec.in -index f9e238b..c01d29f 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -44,7 +44,7 @@ BuildRequires: libvirt-python - BuildRequires: genisoimage - BuildRequires: openssl - BuildRequires: m2crypto --%if 0%{?rhel} -+%if 0%{?rhel} < 7 - BuildRequires: python-ordereddict - %endif - -@@ -174,7 +174,7 @@ Summary: VDSM API Server - BuildArch: noarch - - Requires: %{name}-python = %{version}-%{release} --%if 0%{?rhel} -+%if 0%{?rhel} < 7 - Requires: python-ordereddict - %endif - --- -1.8.1 - diff --git a/0008-vdsm.spec-Don-t-require-python-ordereddict-on-fedora.patch b/0008-vdsm.spec-Don-t-require-python-ordereddict-on-fedora.patch deleted file mode 100644 index 20dcf5b..0000000 --- a/0008-vdsm.spec-Don-t-require-python-ordereddict-on-fedora.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 95765433ada7074f49fb33bb2f2ea59799022e98 Mon Sep 17 00:00:00 2001 -From: Douglas Schilling Landgraf -Date: Tue, 15 Jan 2013 13:16:06 -0500 -Subject: [PATCH 08/22] vdsm.spec: Don't require python-ordereddict on fedora - -It is a regression introduced by commit bb0620f. The condition "0%{?rhel} < 7" -also holds true on fedora, so it causes to require python-ordereddict on fedora - -Change-Id: I87e167f207669f4dda5bb71d7809fe301ea7e905 -Signed-off-by: Mark Wu -Signed-off-by: Douglas Schilling Landgraf -Reviewed-on: http://gerrit.ovirt.org/11057 -Reviewed-by: Dan Kenigsberg ---- - vdsm.spec.in | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/vdsm.spec.in b/vdsm.spec.in -index c01d29f..b518045 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -44,7 +44,7 @@ BuildRequires: libvirt-python - BuildRequires: genisoimage - BuildRequires: openssl - BuildRequires: m2crypto --%if 0%{?rhel} < 7 -+%if 0%{?rhel} == 6 - BuildRequires: python-ordereddict - %endif - -@@ -174,7 +174,7 @@ Summary: VDSM API Server - BuildArch: noarch - - Requires: %{name}-python = %{version}-%{release} --%if 0%{?rhel} < 7 -+%if 0%{?rhel} == 6 - Requires: python-ordereddict - %endif - --- -1.8.1 - diff --git a/0009-vdsm.spec-BuildRequires-python-pthreading.patch b/0009-vdsm.spec-BuildRequires-python-pthreading.patch deleted file mode 100644 index 1aff2c9..0000000 --- a/0009-vdsm.spec-BuildRequires-python-pthreading.patch +++ /dev/null @@ -1,31 +0,0 @@ -From bed07103fc279eefd3f879f7f47e7d3b3c2cd8a9 Mon Sep 17 00:00:00 2001 -From: Douglas Schilling Landgraf -Date: Tue, 15 Jan 2013 14:16:01 -0500 -Subject: [PATCH 09/22] vdsm.spec: BuildRequires: python-pthreading - -Moving python-pthreading to be a generic BuildRequirement - -Change-Id: If996c366cac42e149193651d2d8a6dbde6d8c81e -Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=891542 -Signed-off-by: Douglas Schilling Landgraf -Reviewed-on: http://gerrit.ovirt.org/11058 -Reviewed-by: Dan Kenigsberg ---- - vdsm.spec.in | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/vdsm.spec.in b/vdsm.spec.in -index b518045..14381e5 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -39,6 +39,7 @@ BuildRequires: python-nose - - # BuildRequires needed by the tests during the build - BuildRequires: python-ethtool -+BuildRequires: python-pthreading - BuildRequires: libselinux-python - BuildRequires: libvirt-python - BuildRequires: genisoimage --- -1.8.1 - diff --git a/0010-Searching-for-both-py-and-pyc-file-to-start-super-vd.patch b/0010-Searching-for-both-py-and-pyc-file-to-start-super-vd.patch deleted file mode 100644 index 658729a..0000000 --- a/0010-Searching-for-both-py-and-pyc-file-to-start-super-vd.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 72ff12082013c1682604e2ffb9e8a06b2714d64e Mon Sep 17 00:00:00 2001 -From: Yaniv Bronhaim -Date: Thu, 17 Jan 2013 09:38:43 +0200 -Subject: [PATCH 10/22] Searching for both py and pyc file to start super vdsm - -In oVirt Node we don't keep py files. - -Change-Id: I36771ce46f5d00ad8befe33569252bdb8cffeaa1 -Signed-off-by: Yaniv Bronhaim -Reviewed-on: http://gerrit.ovirt.org/10854 -Reviewed-by: Douglas Schilling Landgraf -Reviewed-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/11133 -Reviewed-by: Vinzenz Feenstra ---- - vdsm/supervdsm.py | 14 +++++++++----- - 1 file changed, 9 insertions(+), 5 deletions(-) - -diff --git a/vdsm/supervdsm.py b/vdsm/supervdsm.py -index 532d5ac..740a93e 100644 ---- a/vdsm/supervdsm.py -+++ b/vdsm/supervdsm.py -@@ -35,19 +35,23 @@ _g_singletonSupervdsmInstance = None - _g_singletonSupervdsmInstance_lock = threading.Lock() - - --def __supervdsmServerPath(serverFile): -+def __supervdsmServerPath(): - base = os.path.dirname(__file__) - -- serverPath = os.path.join(base, serverFile) -- if os.path.exists(serverPath): -- return os.path.abspath(serverPath) -+ # serverFile can be both the py or pyc file. In oVirt node we don't keep -+ # py files. this method looks for one of the two to calculate the absolute -+ # path of supervdsmServer -+ for serverFile in ("supervdsmServer.py", "supervdsmServer.pyc"): -+ serverPath = os.path.join(base, serverFile) -+ if os.path.exists(serverPath): -+ return os.path.abspath(serverPath) - - raise RuntimeError("SuperVDSM Server not found") - - PIDFILE = os.path.join(constants.P_VDSM_RUN, "svdsm.pid") - TIMESTAMP = os.path.join(constants.P_VDSM_RUN, "svdsm.time") - ADDRESS = os.path.join(constants.P_VDSM_RUN, "svdsm.sock") --SUPERVDSM = __supervdsmServerPath("supervdsmServer.py") -+SUPERVDSM = __supervdsmServerPath() - - extraPythonPathList = [] - --- -1.8.1 - diff --git a/0011-adding-getHardwareInfo-API-to-vdsm.patch b/0011-adding-getHardwareInfo-API-to-vdsm.patch deleted file mode 100644 index 85a1509..0000000 --- a/0011-adding-getHardwareInfo-API-to-vdsm.patch +++ /dev/null @@ -1,334 +0,0 @@ -From 6d25123c36637eb82966d52e33330bdbfa733413 Mon Sep 17 00:00:00 2001 -From: Yaniv Bronhaim -Date: Fri, 18 Jan 2013 15:01:37 +0200 -Subject: [PATCH 11/22] adding getHardwareInfo API to vdsm - -Super vdsm retrieves system info about host hardware -parameters. This info will be shown as part of getHardwareInfo -API call in a structure called HardwareInformation. - -This feature currently available only for x86 cpu platfroms, for other -platfroms the api call returns empty dictionary. - -Feature-Description: -http://wiki.ovirt.org/wiki/Features/Design/HostHardwareInfo - -Change-Id: Ic429ef101fcf9047c4b552405314dc7ba9ba07a0 -Signed-off-by: Yaniv Bronhaim -Reviewed-on: http://gerrit.ovirt.org/9258 -Reviewed-by: Barak Azulay -Reviewed-by: Shu Ming -Reviewed-by: Saggi Mizrahi -Reviewed-on: http://gerrit.ovirt.org/11168 -Reviewed-by: Dan Kenigsberg ---- - vdsm.spec.in | 5 +++ - vdsm/API.py | 11 +++++ - vdsm/BindingXMLRPC.py | 5 +++ - vdsm/Makefile.am | 1 + - vdsm/define.py | 3 ++ - vdsm/dmidecodeUtil.py | 99 ++++++++++++++++++++++++++++++++++++++++++++ - vdsm/supervdsmServer.py | 10 +++++ - vdsm_api/vdsmapi-schema.json | 25 +++++++++++ - vdsm_cli/vdsClient.py | 7 ++++ - 9 files changed, 166 insertions(+) - create mode 100644 vdsm/dmidecodeUtil.py - -diff --git a/vdsm.spec.in b/vdsm.spec.in -index 14381e5..5b13419 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -45,6 +45,9 @@ BuildRequires: libvirt-python - BuildRequires: genisoimage - BuildRequires: openssl - BuildRequires: m2crypto -+%ifarch x86_64 -+BuildRequires: python-dmidecode -+%endif - %if 0%{?rhel} == 6 - BuildRequires: python-ordereddict - %endif -@@ -77,6 +80,7 @@ Requires: m2crypto - Requires: %{name}-xmlrpc = %{version}-%{release} - - %ifarch x86_64 -+Requires: python-dmidecode - Requires: dmidecode - %endif - -@@ -610,6 +614,7 @@ exit 0 - %{_datadir}/%{vdsm_name}/blkid.py* - %{_datadir}/%{vdsm_name}/caps.py* - %{_datadir}/%{vdsm_name}/clientIF.py* -+%{_datadir}/%{vdsm_name}/dmidecodeUtil.py* - %{_datadir}/%{vdsm_name}/API.py* - %{_datadir}/%{vdsm_name}/hooking.py* - %{_datadir}/%{vdsm_name}/hooks.py* -diff --git a/vdsm/API.py b/vdsm/API.py -index a1e3f2c..732f8a3 100644 ---- a/vdsm/API.py -+++ b/vdsm/API.py -@@ -1119,6 +1119,17 @@ class Global(APIBase): - - return {'status': doneCode, 'info': c} - -+ def getHardwareInfo(self): -+ """ -+ Report host hardware information -+ """ -+ try: -+ hw = supervdsm.getProxy().getHardwareInfo() -+ return {'status': doneCode, 'info': hw} -+ except: -+ self.log.error("failed to retrieve hardware info", exc_info=True) -+ return errCode['hwInfoErr'] -+ - def getStats(self): - """ - Report host statistics. -diff --git a/vdsm/BindingXMLRPC.py b/vdsm/BindingXMLRPC.py -index 73185b9..f19a8bb 100644 ---- a/vdsm/BindingXMLRPC.py -+++ b/vdsm/BindingXMLRPC.py -@@ -288,6 +288,10 @@ class BindingXMLRPC(object): - ret['info'].update(self.getServerInfo()) - return ret - -+ def getHardwareInfo(self): -+ api = API.Global() -+ return api.getHardwareInfo() -+ - def getStats(self): - api = API.Global() - return api.getStats() -@@ -768,6 +772,7 @@ class BindingXMLRPC(object): - (self.vmGetMigrationStatus, 'migrateStatus'), - (self.vmMigrationCancel, 'migrateCancel'), - (self.getCapabilities, 'getVdsCapabilities'), -+ (self.getHardwareInfo, 'getVdsHardwareInfo'), - (self.getStats, 'getVdsStats'), - (self.vmGetStats, 'getVmStats'), - (self.getAllVmStats, 'getAllVmStats'), -diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am -index dc0590e..88b3287 100644 ---- a/vdsm/Makefile.am -+++ b/vdsm/Makefile.am -@@ -32,6 +32,7 @@ dist_vdsm_PYTHON = \ - configNetwork.py \ - debugPluginClient.py \ - dummybr.py \ -+ dmidecodeUtil.py \ - guestIF.py \ - hooking.py \ - hooks.py \ -diff --git a/vdsm/define.py b/vdsm/define.py -index efebea1..01b0c60 100644 ---- a/vdsm/define.py -+++ b/vdsm/define.py -@@ -127,6 +127,9 @@ errCode = {'noVM': {'status': - 'updateDevice': {'status': - {'code': 56, - 'message': 'Failed to update device'}}, -+ 'hwInfoErr': {'status': -+ {'code': 57, -+ 'message': 'Failed to read hardware information'}}, - 'recovery': {'status': - {'code': 99, - 'message': -diff --git a/vdsm/dmidecodeUtil.py b/vdsm/dmidecodeUtil.py -new file mode 100644 -index 0000000..eb8d834 ---- /dev/null -+++ b/vdsm/dmidecodeUtil.py -@@ -0,0 +1,99 @@ -+# -+# Copyright 2012 Red 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 -+# -+ -+import dmidecode -+from vdsm import utils -+ -+ -+# This function gets dict and returns new dict that includes only string -+# value for each key. Keys in d that their value is a dictionary will be -+# ignored because those keys define a lable for the sub dictionary -+# (and those keys are irrelevant for us in dmidecode output) -+def __leafDict(d): -+ ret = {} -+ for k, v in d.iteritems(): -+ if isinstance(v, dict): -+ ret.update(__leafDict(v)) -+ else: -+ ret[k] = v -+ return ret -+ -+ -+@utils.memoized -+def getAllDmidecodeInfo(): -+ myLeafDict = {} -+ for k in ('system', 'bios', 'cache', 'processor', 'chassis', 'memory'): -+ myLeafDict[k] = __leafDict(getattr(dmidecode, k)()) -+ return myLeafDict -+ -+ -+@utils.memoized -+def getHardwareInfoStructure(): -+ dmiInfo = getAllDmidecodeInfo() -+ sysStruct = {} -+ for k1, k2 in (('system', 'Manufacturer'), -+ ('system', 'Product Name'), -+ ('system', 'Version'), -+ ('system', 'Serial Number'), -+ ('system', 'UUID'), -+ ('system', 'Family')): -+ sysStruct[(k1 + k2).replace(' ', '')] = dmiInfo[k1][k2] -+ -+ return sysStruct -+ -+ -+def printInfo(d): -+ -+ def formatData(data): -+ return '\n'.join(['%s - %s' % (k, v) for k, v in data.iteritems()]) -+ -+ print( -+ """ -+ SYSTEM INFORMATION -+ ================== -+{system} -+ -+ BIOS INFORMATION -+ ================ -+{bios} -+ -+ CACHE INFORMATION -+ ================= -+{cache} -+ -+ PROCESSOR INFO -+ ============== -+{processor} -+ -+ CHASSIS INFO -+ ============ -+{chassis} -+ -+ MEMORY INFORMATION -+ ================== -+{memory} -+ """.format( -+ system=formatData(d['system']), -+ bios=formatData(d['bios']), -+ cache=formatData(d['cache']), -+ processor=formatData(d['processor']), -+ chassis=formatData(d['chassis']), -+ memory=formatData(d['memory'])) -+ ) -diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py -index 5effd41..dc89218 100755 ---- a/vdsm/supervdsmServer.py -+++ b/vdsm/supervdsmServer.py -@@ -17,6 +17,7 @@ - # Refer to the README and COPYING files for full details of the license - # - -+import platform - import logging - import logging.config - import sys -@@ -94,6 +95,15 @@ class _SuperVdsm(object): - return True - - @logDecorator -+ def getHardwareInfo(self, *args, **kwargs): -+ if platform.machine() in ('x86_64', 'i686'): -+ from dmidecodeUtil import getHardwareInfoStructure -+ return getHardwareInfoStructure() -+ else: -+ # not implemented over other architecture -+ return {} -+ -+ @logDecorator - def getDevicePartedInfo(self, *args, **kwargs): - return _getDevicePartedInfo(*args, **kwargs) - -diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json -index 7c9ef22..b69d33e 100644 ---- a/vdsm_api/vdsmapi-schema.json -+++ b/vdsm_api/vdsmapi-schema.json -@@ -690,6 +690,31 @@ - 'data': {'release': 'str', 'version': 'str', 'name': 'OSName'}} - - ## -+# @HardwareInformation: -+# -+# Host hardware fields. -+# -+# @systemManufacturer:  Host manufacturer's name -+# -+# @systemProductName:   Host's hardware module -+# -+# @systemSerialNumber:  Hardware serial number -+# -+# @systemFamily:        Processor type -+# -+# @systemUUID:          Host's hardware UUID -+# -+# @systemVersion:       Host's hardware version -+# -+# Since: 4.10.3 -+## -+{'type': 'HardwareInformation', -+ 'data': {'systemManufacturer': 'str', -+ 'systemProductName': 'str', 'systemVersion': 'str', -+ 'systemSerialNumber': 'str', 'systemUUID': 'str', -+ 'systemFamily': 'str'}} -+ -+## - # @SoftwarePackage: - # - # An enumeration of aliases for important software components. -diff --git a/vdsm_cli/vdsClient.py b/vdsm_cli/vdsClient.py -index c67e3fe..884dc5d 100644 ---- a/vdsm_cli/vdsClient.py -+++ b/vdsm_cli/vdsClient.py -@@ -411,6 +411,9 @@ class service: - def do_getCap(self, args): - return self.ExecAndExit(self.s.getVdsCapabilities()) - -+ def do_getHardware(self, args): -+ return self.ExecAndExit(self.s.getVdsHardwareInfo()) -+ - def do_getVdsStats(self, args): - return self.ExecAndExit(self.s.getVdsStats()) - -@@ -1900,6 +1903,10 @@ if __name__ == '__main__': - ('', - 'Get Capabilities info of the VDS' - )), -+ 'getVdsHardwareInfo': (serv.do_getHardware, -+ ('', -+ 'Get hardware info of the VDS' -+ )), - 'getVdsStats': (serv.do_getVdsStats, - ('', - 'Get Statistics info on the VDS' --- -1.8.1 - diff --git a/0012-Explicitly-shutdown-m2crypto-socket.patch b/0012-Explicitly-shutdown-m2crypto-socket.patch deleted file mode 100644 index 00ac452..0000000 --- a/0012-Explicitly-shutdown-m2crypto-socket.patch +++ /dev/null @@ -1,55 +0,0 @@ -From dcdc1ce83f0f4d426d31401ca14fb8c685150c45 Mon Sep 17 00:00:00 2001 -From: Andrey Gordeev -Date: Mon, 14 Jan 2013 10:30:52 +0100 -Subject: [PATCH 12/22] Explicitly shutdown m2crypto socket - -Aparently some versions of the m2crypto library don't shutdown correctly -underlying sockets when a SSL connection is closed. - -In Python 2.6.6 (the version in RHEL6 and in CentOS6) when the XML RPC -server closes a connection it calls the shutdown method on that -connection with sock.SHUT_WR as the parameter. This works fine for plain -sockets, and works well also for SSL sockets using the builtin ssl -module as it translates the call to shutdown to a complete shutdown of -the SSL connection. But m2crypto does an different translation and the -net result is that the underlying SSL connection is not completely -closed. - -In Python 2.7.3 (the version in Fedora 18) when the XML RPC server -closes a connection it calls the shutdown method on that connection with -sock.SHUT_RDWR, so no matter what SSL implementation is used the -underlying SSL connection is completely closed. - -This patch changes the SSLSocket class so that it explicitly shuts down -and closes the underlying socket when when the connection is closed. - -Change-Id: Ie1a471aaccb32554b94340ebfb92b9d7ba14407a -Signed-off-by: Juan Hernandez -Reviewed-on: http://gerrit.ovirt.org/10972 -Reviewed-by: Dan Kenigsberg -Tested-by: Dan Kenigsberg -Signed-off-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/11384 -Reviewed-by: Federico Simoncelli ---- - vdsm/SecureXMLRPCServer.py | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/vdsm/SecureXMLRPCServer.py b/vdsm/SecureXMLRPCServer.py -index 2de1cf7..bad2067 100644 ---- a/vdsm/SecureXMLRPCServer.py -+++ b/vdsm/SecureXMLRPCServer.py -@@ -57,6 +57,10 @@ class SSLSocket(object): - def gettimeout(self): - return self.connection.socket.gettimeout() - -+ def close(self): -+ self.connection.shutdown(socket.SHUT_RDWR) -+ self.connection.close() -+ - def __getattr__(self, name): - # This is how we delegate all the rest of the methods to the - # underlying SSL connection: --- -1.8.1 - diff --git a/0013-spec-require-policycoreutils-and-skip-sebool-errors.patch b/0013-spec-require-policycoreutils-and-skip-sebool-errors.patch deleted file mode 100644 index d8f3a98..0000000 --- a/0013-spec-require-policycoreutils-and-skip-sebool-errors.patch +++ /dev/null @@ -1,59 +0,0 @@ -From f28df85573914d1ccb57fdc7bae5121a9a24576c Mon Sep 17 00:00:00 2001 -From: Federico Simoncelli -Date: Tue, 11 Dec 2012 04:01:21 -0500 -Subject: [PATCH 13/22] spec: require policycoreutils and skip sebool errors - -In order to avoid a policycoreutils bug (rhbz 883355) when selinux is -disabled we now require the version 2.1.13-44 (or newer) of Fedora. -Additionally we now skip any error in the rpm scriptlets for the sebool -configuration (sebool-config) since they could interfere with the rpm -installation potentially leaving multiple packages installed. - -Change-Id: Iefd5f53c9118eeea6817ce9660ea18abcfd1955c -Signed-off-by: Federico Simoncelli -Reviewed-on: http://gerrit.ovirt.org/9840 -Reviewed-by: Douglas Schilling Landgraf -Reviewed-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/11363 ---- - vdsm.spec.in | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/vdsm.spec.in b/vdsm.spec.in -index 5b13419..e153880 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -131,6 +131,12 @@ Requires: selinux-policy-targeted >= 3.10.0-149 - Requires: lvm2 >= 2.02.95 - %endif - -+# In order to avoid a policycoreutils bug (rhbz 883355) when selinux is -+# disabled we now require the version 2.1.13-44 (or newer) of Fedora. -+%if 0%{?fedora} >= 18 -+Requires: policycoreutils >= 2.1.13-44 -+%endif -+ - Requires: libvirt-python, libvirt-lock-sanlock, libvirt-client - Requires: psmisc >= 22.6-15 - Requires: fence-agents -@@ -479,7 +485,7 @@ export LC_ALL=C - /usr/sbin/usermod -a -G %{qemu_group},%{vdsm_group} %{snlk_user} - - %post --%{_bindir}/vdsm-tool sebool-config -+%{_bindir}/vdsm-tool sebool-config || : - # set the vdsm "secret" password for libvirt - %{_bindir}/vdsm-tool set-saslpasswd - -@@ -521,7 +527,7 @@ then - /bin/sed -i '/# VDSM section begin/,/# VDSM section end/d' \ - /etc/sysctl.conf - -- %{_bindir}/vdsm-tool sebool-unconfig -+ %{_bindir}/vdsm-tool sebool-unconfig || : - - /usr/sbin/saslpasswd2 -p -a libvirt -d vdsm@ovirt - --- -1.8.1 - diff --git a/0014-spec-requires-selinux-policy-to-avoid-selinux-failur.patch b/0014-spec-requires-selinux-policy-to-avoid-selinux-failur.patch deleted file mode 100644 index 360ec83..0000000 --- a/0014-spec-requires-selinux-policy-to-avoid-selinux-failur.patch +++ /dev/null @@ -1,42 +0,0 @@ -From d28299352e54fe6615aba70280f76d25a088f851 Mon Sep 17 00:00:00 2001 -From: Mark Wu -Date: Wed, 23 Jan 2013 10:55:47 +0800 -Subject: [PATCH 14/22] spec: requires selinux-policy to avoid selinux failure - on access tls cert - -selinux-policy tightened up the security on svirt_t on fedora18. It causes -that svirt_t is disallowed to access cert_t file. And therefore it will block -qemu run spice server with tls. For more details, please see: -https://bugzilla.redhat.com/show_bug.cgi?id=890345 - -Change-Id: I9fe74c6187e7e9f2a8c0b2a824d2871fb5497d86 -Signed-off-by: Mark Wu -Reviewed-on: http://gerrit.ovirt.org/11290 -Reviewed-by: Douglas Schilling Landgraf -Reviewed-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/11364 -Tested-by: Federico Simoncelli -Reviewed-by: Federico Simoncelli ---- - vdsm.spec.in | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/vdsm.spec.in b/vdsm.spec.in -index e153880..dfc2459 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -131,9 +131,10 @@ Requires: selinux-policy-targeted >= 3.10.0-149 - Requires: lvm2 >= 2.02.95 - %endif - -+%if 0%{?fedora} >= 18 -+Requires: selinux-policy-targeted >= 3.11.1-71 - # In order to avoid a policycoreutils bug (rhbz 883355) when selinux is - # disabled we now require the version 2.1.13-44 (or newer) of Fedora. --%if 0%{?fedora} >= 18 - Requires: policycoreutils >= 2.1.13-44 - %endif - --- -1.8.1 - diff --git a/0015-vdsmd.service-require-either-ntpd-or-chronyd.patch b/0015-vdsmd.service-require-either-ntpd-or-chronyd.patch deleted file mode 100644 index cceab27..0000000 --- a/0015-vdsmd.service-require-either-ntpd-or-chronyd.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 8a0e831eafedb0aefc6aadab7ac1448cab6b7643 Mon Sep 17 00:00:00 2001 -From: Dan Kenigsberg -Date: Wed, 23 Jan 2013 10:27:01 +0200 -Subject: [PATCH 15/22] vdsmd.service: require either ntpd or chronyd - -Fedora 18 ships with chronyd by default, which conflicts with ntpd. We -do not really care which one of the two is running, as long as the host -clock is synchronized. That's what requiring time-sync.target means. - -Change-Id: Ie0605bea6d34c214aea8814a72a03e9ad2883fdb -Signed-off-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/11291 -Reviewed-by: Zhou Zheng Sheng -Reviewed-by: Antoni Segura Puimedon -Reviewed-on: http://gerrit.ovirt.org/11366 -Reviewed-by: Federico Simoncelli -Tested-by: Federico Simoncelli ---- - vdsm/vdsmd.service | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/vdsm/vdsmd.service b/vdsm/vdsmd.service -index 6a650f4..9823b34 100644 ---- a/vdsm/vdsmd.service -+++ b/vdsm/vdsmd.service -@@ -1,6 +1,6 @@ - [Unit] - Description=Virtual Desktop Server Manager --Requires=multipathd.service libvirtd.service ntpd.service -+Requires=multipathd.service libvirtd.service time-sync.target - Conflicts=libvirt-guests.service - - [Service] --- -1.8.1 - diff --git a/0016-isRunning-didn-t-check-local-variable-before-reading.patch b/0016-isRunning-didn-t-check-local-variable-before-reading.patch deleted file mode 100644 index c2b85cb..0000000 --- a/0016-isRunning-didn-t-check-local-variable-before-reading.patch +++ /dev/null @@ -1,44 +0,0 @@ -From c95e492ccef335e82b2eb79495c35d08beab6629 Mon Sep 17 00:00:00 2001 -From: Yaniv Bronhaim -Date: Thu, 17 Jan 2013 10:01:54 +0200 -Subject: [PATCH 16/22] isRunning didn't check local variable before reading - saved data - -All internal svdsm files contained last svdsm instance info, -after restart we didn't verify local manager instance before processing -the operation and got AttributeError exception when calling svdsm -manager. - -This returns false when _svdsm instance is None or in firstLaunch. - -Change-Id: I9dec0c6955dadcd959cc1c8df4e9745322fb0ce3 -Bug-Id: https://bugzilla.redhat.com/show_bug.cgi?id=890365 -Signed-off-by: Yaniv Bronhaim -Reviewed-on: http://gerrit.ovirt.org/10491 -Reviewed-by: Ayal Baron -Reviewed-on: http://gerrit.ovirt.org/11135 -Reviewed-by: Dan Kenigsberg -Reviewed-by: Douglas Schilling Landgraf -Reviewed-by: Federico Simoncelli -Tested-by: Federico Simoncelli ---- - vdsm/supervdsm.py | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/vdsm/supervdsm.py b/vdsm/supervdsm.py -index 740a93e..6a38076 100644 ---- a/vdsm/supervdsm.py -+++ b/vdsm/supervdsm.py -@@ -148,6 +148,9 @@ class SuperVdsmProxy(object): - self._firstLaunch = True - - def isRunning(self): -+ if self._firstLaunch or self._svdsm is None: -+ return False -+ - try: - with open(self.pidfile, "r") as f: - spid = f.read().strip() --- -1.8.1 - diff --git a/0017-udev-Race-fix-load-and-trigger-dev-rule.patch b/0017-udev-Race-fix-load-and-trigger-dev-rule.patch deleted file mode 100644 index 7615ee8..0000000 --- a/0017-udev-Race-fix-load-and-trigger-dev-rule.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 959a8703937f01161988221940d189acc4f7a796 Mon Sep 17 00:00:00 2001 -From: Federico Simoncelli -Date: Sun, 13 Jan 2013 16:21:55 +0200 -Subject: [PATCH 17/22] udev: Race fix- load and trigger dev rule - -The rule file is generated, yet not synch-loaded in memory, so a VM with -a direct lun fails to start. -This patch reloads the rules before triggering using the new private -udev functions - udevReloadRules() in supervdsmServer.py . -Also added a check in appropriateDevice() (hsm.py) to make sure the -mapping is indeed there. - -Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=891300 -Change-Id: If3b2008a3d9df2dcaf54190721c2dd9764338627 -Signed-off-by: Lee Yarwood -Signed-off-by: Vered Volansky -Signed-off-by: Federico Simoncelli -Reviewed-on: http://gerrit.ovirt.org/11410 -Reviewed-by: Allon Mureinik ---- - vdsm/storage/hsm.py | 7 +++++++ - vdsm/supervdsmServer.py | 31 +++++++++++++++++++++++++++++++ - 2 files changed, 38 insertions(+) - -diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py -index efb2749..62e9f74 100644 ---- a/vdsm/storage/hsm.py -+++ b/vdsm/storage/hsm.py -@@ -67,6 +67,7 @@ import mount - import dispatcher - import supervdsm - import storageServer -+from vdsm import utils - - GUID = "guid" - NAME = "name" -@@ -87,6 +88,8 @@ SECTOR_SIZE = 512 - - STORAGE_CONNECTION_DIR = os.path.join(constants.P_VDSM_RUN, "connections/") - -+QEMU_READABLE_TIMEOUT = 30 -+ - - def public(f=None, **kwargs): - if f is None: -@@ -2925,6 +2928,10 @@ class HSM: - """ - supervdsm.getProxy().appropriateDevice(guid, thiefId) - supervdsm.getProxy().udevTrigger(guid) -+ devPath = devicemapper.DMPATH_FORMAT % guid -+ utils.retry(partial(fileUtils.validateQemuReadable, devPath), -+ expectedException=OSError, -+ timeout=QEMU_READABLE_TIMEOUT) - - @public - def inappropriateDevices(self, thiefId): -diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py -index dc89218..833e91f 100755 ---- a/vdsm/supervdsmServer.py -+++ b/vdsm/supervdsmServer.py -@@ -89,6 +89,10 @@ LOG_CONF_PATH = "/etc/vdsm/logger.conf" - - class _SuperVdsm(object): - -+ UDEV_WITH_RELOAD_VERSION = 181 -+ -+ log = logging.getLogger("SuperVdsm.ServerCallback") -+ - @logDecorator - def ping(self, *args, **kwargs): - # This method exists for testing purposes -@@ -226,6 +230,7 @@ class _SuperVdsm(object): - - @logDecorator - def udevTrigger(self, guid): -+ self.__udevReloadRules(guid) - cmd = [EXT_UDEVADM, 'trigger', '--verbose', '--action', 'change', - '--property-match=DM_NAME=%s' % guid] - rc, out, err = misc.execCmd(cmd, sudo=False) -@@ -304,6 +309,32 @@ class _SuperVdsm(object): - def removeFs(self, path): - return mkimage.removeFs(path) - -+ def __udevReloadRules(self, guid): -+ if self.__udevOperationReload(): -+ reload = "--reload" -+ else: -+ reload = "--reload-rules" -+ cmd = [EXT_UDEVADM, 'control', reload] -+ rc, out, err = misc.execCmd(cmd, sudo=False) -+ if rc: -+ self.log.error("Udevadm reload-rules command failed rc=%s, " -+ "out=\"%s\", err=\"%s\"", rc, out, err) -+ raise OSError(errno.EINVAL, "Could not reload-rules for device " -+ "%s" % guid) -+ -+ @utils.memoized -+ def __udevVersion(self): -+ cmd = [EXT_UDEVADM, '--version'] -+ rc, out, err = misc.execCmd(cmd, sudo=False) -+ if rc: -+ self.log.error("Udevadm version command failed rc=%s, " -+ " out=\"%s\", err=\"%s\"", rc, out, err) -+ raise RuntimeError("Could not get udev version number") -+ return int(out[0]) -+ -+ def __udevOperationReload(self): -+ return self.__udevVersion() > self.UDEV_WITH_RELOAD_VERSION -+ - - def __pokeParent(parentPid, address, log): - try: --- -1.8.1 - diff --git a/0018-Change-scsi_id-command-path-to-be-configured-at-runt.patch b/0018-Change-scsi_id-command-path-to-be-configured-at-runt.patch deleted file mode 100644 index 2412a47..0000000 --- a/0018-Change-scsi_id-command-path-to-be-configured-at-runt.patch +++ /dev/null @@ -1,171 +0,0 @@ -From c7ee9217ec6edebec7b1d3a2536792114fd1a258 Mon Sep 17 00:00:00 2001 -From: Yeela Kaplan -Date: Fri, 25 Jan 2013 15:54:07 +0200 -Subject: [PATCH 18/22] Change scsi_id command path to be configured at runtime - -On fedora 18 scsi_id path is no longer under /sbin/scsi_id, -we configure vdsm to look for the path at runtime -and thus remove it from constants. - -Change-Id: I409d4da0ba429564466271aded32e96f9401cd6c -Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=886087 -Signed-off-by: Yeela Kaplan -Reviewed-on: http://gerrit.ovirt.org/10824 -Reviewed-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/11393 -Tested-by: Federico Simoncelli ---- - configure.ac | 2 -- - vdsm/constants.py.in | 24 ------------------------ - vdsm/storage/multipath.py | 45 ++++++++++++++++++++++++++++++++++++++++----- - vdsm/sudoers.vdsm.in | 1 - - 4 files changed, 40 insertions(+), 32 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 3489e38..edc0b50 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -167,8 +167,6 @@ AC_PATH_PROG([QEMUIMG_PATH], [qemu-img], [/usr/bin/qemu-img]) - AC_PATH_PROG([REBOOT_PATH], [reboot], [/usr/bin/reboot]) - AC_PATH_PROG([RPM_PATH], [rpm], [/bin/rpm]) - AC_PATH_PROG([RSYNC_PATH], [rsync], [/usr/bin/rsync]) --AC_PATH_PROG([SCSI_ID_PATH], [scsi_id], [/sbin/scsi_id], -- [$PATH$PATH_SEPARATOR/lib/udev]) - AC_PATH_PROG([SED_PATH], [sed], [/bin/sed]) - AC_PATH_PROG([SERVICE_PATH], [service], [/sbin/service]) - AC_PATH_PROG([SETSID_PATH], [setsid], [/usr/bin/setsid]) -diff --git a/vdsm/constants.py.in b/vdsm/constants.py.in -index 8034b8e..ec5fff9 100644 ---- a/vdsm/constants.py.in -+++ b/vdsm/constants.py.in -@@ -127,7 +127,6 @@ EXT_QEMUIMG = '@QEMUIMG_PATH@' - EXT_REBOOT = '@REBOOT_PATH@' - EXT_RSYNC = '@RSYNC_PATH@' - --EXT_SCSI_ID = '@SCSI_ID_PATH@' # TBD ! - EXT_SERVICE = '@SERVICE_PATH@' - EXT_SETSID = '@SETSID_PATH@' - EXT_SH = '/bin/sh' # The shell path is invariable -@@ -157,26 +156,3 @@ CMD_LOWPRIO = [EXT_NICE, '-n', '19', EXT_IONICE, '-c', '3'] - STRG_ISCSI_HOST = "iscsi_host/" - STRG_SCSI_HOST = "scsi_host/" - STRG_ISCSI_SESSION = "iscsi_session/" --STRG_MPATH_CONF = ( -- "\n\n" -- "defaults {\n" -- " polling_interval 5\n" -- " getuid_callout \"@SCSI_ID_PATH@ --whitelisted " -- "--replace-whitespace --device=/dev/%n\"\n" -- " no_path_retry fail\n" -- " user_friendly_names no\n" -- " flush_on_last_del yes\n" -- " fast_io_fail_tmo 5\n" -- " dev_loss_tmo 30\n" -- " max_fds 4096\n" -- "}\n" -- "\n" -- "devices {\n" -- "device {\n" -- " vendor \"HITACHI\"\n" -- " product \"DF.*\"\n" -- " getuid_callout \"@SCSI_ID_PATH@ --whitelisted " -- "--replace-whitespace --device=/dev/%n\"\n" -- "}\n" -- "}" --) -diff --git a/vdsm/storage/multipath.py b/vdsm/storage/multipath.py -index 741f1a1..05fd186 100644 ---- a/vdsm/storage/multipath.py -+++ b/vdsm/storage/multipath.py -@@ -30,6 +30,7 @@ import re - from collections import namedtuple - - from vdsm import constants -+from vdsm import utils - import misc - import iscsi - import supervdsm -@@ -49,13 +50,47 @@ MPATH_CONF = "/etc/multipath.conf" - - OLD_TAGS = ["# RHAT REVISION 0.2", "# RHEV REVISION 0.3", - "# RHEV REVISION 0.4", "# RHEV REVISION 0.5", -- "# RHEV REVISION 0.6", "# RHEV REVISION 0.7"] --MPATH_CONF_TAG = "# RHEV REVISION 0.8" -+ "# RHEV REVISION 0.6", "# RHEV REVISION 0.7", -+ "# RHEV REVISION 0.8", "# RHEV REVISION 0.9"] -+MPATH_CONF_TAG = "# RHEV REVISION 1.0" - MPATH_CONF_PRIVATE_TAG = "# RHEV PRIVATE" --MPATH_CONF_TEMPLATE = MPATH_CONF_TAG + constants.STRG_MPATH_CONF -+STRG_MPATH_CONF = ( -+ "\n\n" -+ "defaults {\n" -+ " polling_interval 5\n" -+ " getuid_callout \"%(scsi_id_path)s --whitelisted " -+ "--replace-whitespace --device=/dev/%%n\"\n" -+ " no_path_retry fail\n" -+ " user_friendly_names no\n" -+ " flush_on_last_del yes\n" -+ " fast_io_fail_tmo 5\n" -+ " dev_loss_tmo 30\n" -+ " max_fds 4096\n" -+ "}\n" -+ "\n" -+ "devices {\n" -+ "device {\n" -+ " vendor \"HITACHI\"\n" -+ " product \"DF.*\"\n" -+ " getuid_callout \"%(scsi_id_path)s --whitelisted " -+ "--replace-whitespace --device=/dev/%%n\"\n" -+ "}\n" -+ "device {\n" -+ " vendor \"COMPELNT\"\n" -+ " product \"Compellent Vol\"\n" -+ " no_path_retry fail\n" -+ "}\n" -+ "}" -+) -+MPATH_CONF_TEMPLATE = MPATH_CONF_TAG + STRG_MPATH_CONF - - log = logging.getLogger("Storage.Multipath") - -+_scsi_id = utils.CommandPath("scsi_id", -+ "/sbin/scsi_id", # EL6 -+ "/usr/lib/udev/scsi_id", # Fedora -+ ) -+ - - def rescan(): - """ -@@ -127,7 +162,7 @@ def setupMultipath(): - os.path.basename(MPATH_CONF), MAX_CONF_COPIES, - cp=True, persist=True) - with tempfile.NamedTemporaryFile() as f: -- f.write(MPATH_CONF_TEMPLATE) -+ f.write(MPATH_CONF_TEMPLATE % {'scsi_id_path': _scsi_id.cmd}) - f.flush() - cmd = [constants.EXT_CP, f.name, MPATH_CONF] - rc = misc.execCmd(cmd, sudo=True)[0] -@@ -173,7 +208,7 @@ def getDeviceSize(dev): - - def getScsiSerial(physdev): - blkdev = os.path.join("/dev", physdev) -- cmd = [constants.EXT_SCSI_ID, -+ cmd = [_scsi_id.cmd, - "--page=0x80", - "--whitelisted", - "--export", -diff --git a/vdsm/sudoers.vdsm.in b/vdsm/sudoers.vdsm.in -index ab99e8e..4fc75f9 100644 ---- a/vdsm/sudoers.vdsm.in -+++ b/vdsm/sudoers.vdsm.in -@@ -23,7 +23,6 @@ Cmnd_Alias VDSM_STORAGE = @MOUNT_PATH@, @UMOUNT_PATH@, \ - @SERVICE_PATH@ iscsid *, \ - @SERVICE_PATH@ multipathd restart, \ - @SERVICE_PATH@ multipathd reload, \ -- @SCSI_ID_PATH@, \ - @ISCSIADM_PATH@ *, \ - @LVM_PATH@, \ - @CAT_PATH@ /sys/block/*/device/../../*, \ --- -1.8.1 - diff --git a/0019-upgrade-force-upgrade-to-v2-before-upgrading-to-v3.patch b/0019-upgrade-force-upgrade-to-v2-before-upgrading-to-v3.patch deleted file mode 100644 index 5a1c4a9..0000000 --- a/0019-upgrade-force-upgrade-to-v2-before-upgrading-to-v3.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 33480cbc90a4810aa99e3fc7b36e879cdb0c19d4 Mon Sep 17 00:00:00 2001 -From: Federico Simoncelli -Date: Wed, 9 Jan 2013 09:57:52 +0200 -Subject: [PATCH 19/22] upgrade: force upgrade to v2 before upgrading to v3 - -During the upgrade of a domain to version 3 vdsm reallocates the -metadata slots that are higher than 1947 (given a leases LV of 2Gb) -in order to use the same offsets for the volume leases (BZ#882276 -and git commit hash 2ba76e3). -This has no effect when the domain is version 0 since the metadata -slots offsets are fixed (the first physical extent of the LV) and -they can't be reallocated. In such case the domain must be upgraded -to version 2 first. - -Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=893184 -Change-Id: I2bd424ad29e76d1368ff2959bb8fe45afc595cdb -Signed-off-by: Federico Simoncelli -Reviewed-on: http://gerrit.ovirt.org/10792 -Reviewed-by: Ayal Baron -Tested-by: Haim Ateya -Reviewed-on: http://gerrit.ovirt.org/11462 ---- - vdsm/storage/imageRepository/formatConverter.py | 26 +++++++++++++++++-------- - vdsm/storage/volume.py | 4 +++- - 2 files changed, 21 insertions(+), 9 deletions(-) - -diff --git a/vdsm/storage/imageRepository/formatConverter.py b/vdsm/storage/imageRepository/formatConverter.py -index 0d7dd6d..88b053d 100644 ---- a/vdsm/storage/imageRepository/formatConverter.py -+++ b/vdsm/storage/imageRepository/formatConverter.py -@@ -93,6 +93,23 @@ def v3DomainConverter(repoPath, hostId, domain, isMsd): - log = logging.getLogger('Storage.v3DomainConverter') - log.debug("Starting conversion for domain %s", domain.sdUUID) - -+ targetVersion = 3 -+ currentVersion = domain.getVersion() -+ -+ # For block domains if we're upgrading from version 0 we need to first -+ # upgrade to version 2 and then proceed to upgrade to version 3. -+ if domain.getStorageType() in sd.BLOCK_DOMAIN_TYPES: -+ if currentVersion == 0: -+ log.debug("Upgrading domain %s from version %s to version 2", -+ domain.sdUUID, currentVersion) -+ v2DomainConverter(repoPath, hostId, domain, isMsd) -+ currentVersion = domain.getVersion() -+ -+ if currentVersion != 2: -+ log.debug("Unsupported conversion from version %s to version %s", -+ currentVersion, targetVersion) -+ raise se.UnsupportedDomainVersion(currentVersion) -+ - if domain.getStorageType() in sd.FILE_DOMAIN_TYPES: - log.debug("Setting permissions for domain %s", domain.sdUUID) - domain.setMetadataPermissions() -@@ -268,17 +285,10 @@ def v3DomainConverter(repoPath, hostId, domain, isMsd): - "not critical since the volume might be in use", - imgUUID, exc_info=True) - -- targetVersion = 3 -- currentVersion = domain.getVersion() - log.debug("Finalizing the storage domain upgrade from version %s to " - "version %s for domain %s", currentVersion, targetVersion, - domain.sdUUID) -- -- if (currentVersion not in blockSD.VERS_METADATA_TAG -- and domain.getStorageType() in sd.BLOCK_DOMAIN_TYPES): -- __convertDomainMetadataToTags(domain, targetVersion) -- else: -- domain.setMetaParam(sd.DMDK_VERSION, targetVersion) -+ domain.setMetaParam(sd.DMDK_VERSION, targetVersion) - - except: - if isMsd: -diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py -index cde612a..12dd188 100644 ---- a/vdsm/storage/volume.py -+++ b/vdsm/storage/volume.py -@@ -503,7 +503,9 @@ class Volume(object): - cls.newMetadata(metaId, sdUUID, imgUUID, srcVolUUID, size, - type2name(volFormat), type2name(preallocate), - volType, diskType, desc, LEGAL_VOL) -- cls.newVolumeLease(metaId, sdUUID, volUUID) -+ -+ if dom.hasVolumeLeases(): -+ cls.newVolumeLease(metaId, sdUUID, volUUID) - - except se.StorageException: - cls.log.error("Unexpected error", exc_info=True) --- -1.8.1 - diff --git a/0020-misc-rename-safelease-to-clusterlock.patch b/0020-misc-rename-safelease-to-clusterlock.patch deleted file mode 100644 index 3e1684c..0000000 --- a/0020-misc-rename-safelease-to-clusterlock.patch +++ /dev/null @@ -1,866 +0,0 @@ -From e60206af7781c86ddb5d2ef1fcac3f8f8b086ee4 Mon Sep 17 00:00:00 2001 -From: Federico Simoncelli -Date: Fri, 14 Dec 2012 06:42:09 -0500 -Subject: [PATCH 20/22] misc: rename safelease to clusterlock - -The safelease module is now contaning also the sanlock implementation -and soon it might contain other (e.g.: a special lock for local storage -domains), for this reason it has been renamed with a more general name -clusterlock. The safelease implementation also required some cleanup in -order to achieve more uniformity between the locking mechanisms. - -Change-Id: I74070ebb43dd726362900a0746c08b2ee3d6eac7 -Signed-off-by: Federico Simoncelli -Reviewed-on: http://gerrit.ovirt.org/10067 -Reviewed-by: Allon Mureinik -Reviewed-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/11463 ---- - vdsm.spec.in | 2 +- - vdsm/API.py | 4 +- - vdsm/storage/Makefile.am | 4 +- - vdsm/storage/blockSD.py | 4 +- - vdsm/storage/clusterlock.py | 251 ++++++++++++++++++++++++ - vdsm/storage/hsm.py | 20 +- - vdsm/storage/imageRepository/formatConverter.py | 6 +- - vdsm/storage/safelease.py | 250 ----------------------- - vdsm/storage/sd.py | 12 +- - vdsm/storage/sp.py | 25 ++- - 10 files changed, 289 insertions(+), 289 deletions(-) - create mode 100644 vdsm/storage/clusterlock.py - delete mode 100644 vdsm/storage/safelease.py - -diff --git a/vdsm.spec.in b/vdsm.spec.in -index dfc2459..8ad4dce 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -685,7 +685,7 @@ exit 0 - %{_datadir}/%{vdsm_name}/storage/resourceFactories.py* - %{_datadir}/%{vdsm_name}/storage/remoteFileHandler.py* - %{_datadir}/%{vdsm_name}/storage/resourceManager.py* --%{_datadir}/%{vdsm_name}/storage/safelease.py* -+%{_datadir}/%{vdsm_name}/storage/clusterlock.py* - %{_datadir}/%{vdsm_name}/storage/sdc.py* - %{_datadir}/%{vdsm_name}/storage/sd.py* - %{_datadir}/%{vdsm_name}/storage/securable.py* -diff --git a/vdsm/API.py b/vdsm/API.py -index 732f8a3..a050a51 100644 ---- a/vdsm/API.py -+++ b/vdsm/API.py -@@ -33,7 +33,7 @@ import configNetwork - from vdsm import netinfo - from vdsm import constants - import storage.misc --import storage.safelease -+import storage.clusterlock - import storage.volume - import storage.sd - import storage.image -@@ -992,7 +992,7 @@ class StoragePool(APIBase): - def spmStart(self, prevID, prevLver, enableScsiFencing, - maxHostID=None, domVersion=None): - if maxHostID is None: -- maxHostID = storage.safelease.MAX_HOST_ID -+ maxHostID = storage.clusterlock.MAX_HOST_ID - recoveryMode = None # unused - return self._irs.spmStart(self._UUID, prevID, prevLver, - recoveryMode, enableScsiFencing, maxHostID, domVersion) -diff --git a/vdsm/storage/Makefile.am b/vdsm/storage/Makefile.am -index cff09be..abc1545 100644 ---- a/vdsm/storage/Makefile.am -+++ b/vdsm/storage/Makefile.am -@@ -25,6 +25,7 @@ dist_vdsmstorage_PYTHON = \ - __init__.py \ - blockSD.py \ - blockVolume.py \ -+ clusterlock.py \ - devicemapper.py \ - dispatcher.py \ - domainMonitor.py \ -@@ -35,8 +36,8 @@ dist_vdsmstorage_PYTHON = \ - hba.py \ - hsm.py \ - image.py \ -+ iscsiadm.py \ - iscsi.py \ -- iscsiadm.py \ - localFsSD.py \ - lvm.py \ - misc.py \ -@@ -48,7 +49,6 @@ dist_vdsmstorage_PYTHON = \ - remoteFileHandler.py \ - resourceFactories.py \ - resourceManager.py \ -- safelease.py \ - sdc.py \ - sd.py \ - securable.py \ -diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py -index 61ec996..862e413 100644 ---- a/vdsm/storage/blockSD.py -+++ b/vdsm/storage/blockSD.py -@@ -37,7 +37,7 @@ import misc - import fileUtils - import sd - import lvm --import safelease -+import clusterlock - import blockVolume - import multipath - import resourceFactories -@@ -63,7 +63,7 @@ log = logging.getLogger("Storage.BlockSD") - - # FIXME: Make this calculated from something logical - RESERVED_METADATA_SIZE = 40 * (2 ** 20) --RESERVED_MAILBOX_SIZE = MAILBOX_SIZE * safelease.MAX_HOST_ID -+RESERVED_MAILBOX_SIZE = MAILBOX_SIZE * clusterlock.MAX_HOST_ID - METADATA_BASE_SIZE = 378 - # VG's min metadata threshold is 20% - VG_MDA_MIN_THRESHOLD = 0.2 -diff --git a/vdsm/storage/clusterlock.py b/vdsm/storage/clusterlock.py -new file mode 100644 -index 0000000..4525b2f ---- /dev/null -+++ b/vdsm/storage/clusterlock.py -@@ -0,0 +1,251 @@ -+# -+# Copyright 2011 Red 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 -+# -+ -+import os -+import threading -+import logging -+import subprocess -+from contextlib import nested -+import sanlock -+ -+import misc -+import storage_exception as se -+from vdsm import constants -+from vdsm.config import config -+ -+ -+MAX_HOST_ID = 250 -+ -+# The LEASE_OFFSET is used by SANLock to not overlap with safelease in -+# orfer to preserve the ability to acquire both locks (e.g.: during the -+# domain upgrade) -+SDM_LEASE_NAME = 'SDM' -+SDM_LEASE_OFFSET = 512 * 2048 -+ -+ -+class SafeLease(object): -+ log = logging.getLogger("SafeLease") -+ -+ lockUtilPath = config.get('irs', 'lock_util_path') -+ lockCmd = config.get('irs', 'lock_cmd') -+ freeLockCmd = config.get('irs', 'free_lock_cmd') -+ -+ def __init__(self, sdUUID, idsPath, leasesPath, lockRenewalIntervalSec, -+ leaseTimeSec, leaseFailRetry, ioOpTimeoutSec): -+ self._lock = threading.Lock() -+ self._sdUUID = sdUUID -+ self._idsPath = idsPath -+ self._leasesPath = leasesPath -+ self.setParams(lockRenewalIntervalSec, leaseTimeSec, leaseFailRetry, -+ ioOpTimeoutSec) -+ -+ def initLock(self): -+ lockUtil = os.path.join(self.lockUtilPath, "safelease") -+ initCommand = [lockUtil, "release", "-f", self._leasesPath, "0"] -+ rc, out, err = misc.execCmd(initCommand, sudo=False, -+ cwd=self.lockUtilPath) -+ if rc != 0: -+ self.log.warn("could not initialise spm lease (%s): %s", rc, out) -+ raise se.ClusterLockInitError() -+ -+ def setParams(self, lockRenewalIntervalSec, leaseTimeSec, leaseFailRetry, -+ ioOpTimeoutSec): -+ self._lockRenewalIntervalSec = lockRenewalIntervalSec -+ self._leaseTimeSec = leaseTimeSec -+ self._leaseFailRetry = leaseFailRetry -+ self._ioOpTimeoutSec = ioOpTimeoutSec -+ -+ def getReservedId(self): -+ return 1000 -+ -+ def acquireHostId(self, hostId, async): -+ self.log.debug("Host id for domain %s successfully acquired (id: %s)", -+ self._sdUUID, hostId) -+ -+ def releaseHostId(self, hostId, async, unused): -+ self.log.debug("Host id for domain %s released successfully (id: %s)", -+ self._sdUUID, hostId) -+ -+ def hasHostId(self, hostId): -+ return True -+ -+ def acquire(self, hostID): -+ leaseTimeMs = self._leaseTimeSec * 1000 -+ ioOpTimeoutMs = self._ioOpTimeoutSec * 1000 -+ with self._lock: -+ self.log.debug("Acquiring cluster lock for domain %s" % -+ self._sdUUID) -+ -+ lockUtil = self.getLockUtilFullPath() -+ acquireLockCommand = subprocess.list2cmdline([ -+ lockUtil, "start", self._sdUUID, str(hostID), -+ str(self._lockRenewalIntervalSec), str(self._leasesPath), -+ str(leaseTimeMs), str(ioOpTimeoutMs), str(self._leaseFailRetry) -+ ]) -+ -+ cmd = [constants.EXT_SETSID, constants.EXT_IONICE, '-c1', '-n0', -+ constants.EXT_SU, misc.IOUSER, '-s', constants.EXT_SH, '-c', -+ acquireLockCommand] -+ (rc, out, err) = misc.execCmd(cmd, cwd=self.lockUtilPath, -+ sudo=True) -+ if rc != 0: -+ raise se.AcquireLockFailure(self._sdUUID, rc, out, err) -+ self.log.debug("Clustered lock acquired successfully") -+ -+ def getLockUtilFullPath(self): -+ return os.path.join(self.lockUtilPath, self.lockCmd) -+ -+ def release(self): -+ with self._lock: -+ freeLockUtil = os.path.join(self.lockUtilPath, self.freeLockCmd) -+ releaseLockCommand = [freeLockUtil, self._sdUUID] -+ self.log.info("Releasing cluster lock for domain %s" % -+ self._sdUUID) -+ (rc, out, err) = misc.execCmd(releaseLockCommand, sudo=False, -+ cwd=self.lockUtilPath) -+ if rc != 0: -+ self.log.error("Could not release cluster lock " -+ "rc=%s out=%s, err=%s" % (str(rc), out, err)) -+ -+ self.log.debug("Cluster lock released successfully") -+ -+ -+class SANLock(object): -+ log = logging.getLogger("SANLock") -+ -+ _sanlock_fd = None -+ _sanlock_lock = threading.Lock() -+ -+ def __init__(self, sdUUID, idsPath, leasesPath, *args): -+ self._lock = threading.Lock() -+ self._sdUUID = sdUUID -+ self._idsPath = idsPath -+ self._leasesPath = leasesPath -+ self._sanlockfd = None -+ -+ def initLock(self): -+ try: -+ sanlock.init_lockspace(self._sdUUID, self._idsPath) -+ sanlock.init_resource(self._sdUUID, SDM_LEASE_NAME, -+ [(self._leasesPath, SDM_LEASE_OFFSET)]) -+ except sanlock.SanlockException: -+ self.log.warn("Cannot initialize clusterlock", exc_info=True) -+ raise se.ClusterLockInitError() -+ -+ def setParams(self, *args): -+ pass -+ -+ def getReservedId(self): -+ return MAX_HOST_ID -+ -+ def acquireHostId(self, hostId, async): -+ with self._lock: -+ self.log.info("Acquiring host id for domain %s (id: %s)", -+ self._sdUUID, hostId) -+ -+ try: -+ sanlock.add_lockspace(self._sdUUID, hostId, self._idsPath, -+ async=async) -+ except sanlock.SanlockException, e: -+ if e.errno == os.errno.EINPROGRESS: -+ # if the request is not asynchronous wait for the ongoing -+ # lockspace operation to complete -+ if not async and not sanlock.inq_lockspace( -+ self._sdUUID, hostId, self._idsPath, wait=True): -+ raise se.AcquireHostIdFailure(self._sdUUID, e) -+ # else silently continue, the host id has been acquired -+ # or it's in the process of being acquired (async) -+ elif e.errno != os.errno.EEXIST: -+ raise se.AcquireHostIdFailure(self._sdUUID, e) -+ -+ self.log.debug("Host id for domain %s successfully acquired " -+ "(id: %s)", self._sdUUID, hostId) -+ -+ def releaseHostId(self, hostId, async, unused): -+ with self._lock: -+ self.log.info("Releasing host id for domain %s (id: %s)", -+ self._sdUUID, hostId) -+ -+ try: -+ sanlock.rem_lockspace(self._sdUUID, hostId, self._idsPath, -+ async=async, unused=unused) -+ except sanlock.SanlockException, e: -+ if e.errno != os.errno.ENOENT: -+ raise se.ReleaseHostIdFailure(self._sdUUID, e) -+ -+ self.log.debug("Host id for domain %s released successfully " -+ "(id: %s)", self._sdUUID, hostId) -+ -+ def hasHostId(self, hostId): -+ with self._lock: -+ try: -+ return sanlock.inq_lockspace(self._sdUUID, -+ hostId, self._idsPath) -+ except sanlock.SanlockException: -+ self.log.debug("Unable to inquire sanlock lockspace " -+ "status, returning False", exc_info=True) -+ return False -+ -+ # The hostId parameter is maintained here only for compatibility with -+ # ClusterLock. We could consider to remove it in the future but keeping it -+ # for logging purpose is desirable. -+ def acquire(self, hostId): -+ with nested(self._lock, SANLock._sanlock_lock): -+ self.log.info("Acquiring cluster lock for domain %s (id: %s)", -+ self._sdUUID, hostId) -+ -+ while True: -+ if SANLock._sanlock_fd is None: -+ try: -+ SANLock._sanlock_fd = sanlock.register() -+ except sanlock.SanlockException, e: -+ raise se.AcquireLockFailure(self._sdUUID, e.errno, -+ "Cannot register to sanlock", str(e)) -+ -+ try: -+ sanlock.acquire(self._sdUUID, SDM_LEASE_NAME, -+ [(self._leasesPath, SDM_LEASE_OFFSET)], -+ slkfd=SANLock._sanlock_fd) -+ except sanlock.SanlockException, e: -+ if e.errno != os.errno.EPIPE: -+ raise se.AcquireLockFailure(self._sdUUID, e.errno, -+ "Cannot acquire cluster lock", str(e)) -+ SANLock._sanlock_fd = None -+ continue -+ -+ break -+ -+ self.log.debug("Cluster lock for domain %s successfully acquired " -+ "(id: %s)", self._sdUUID, hostId) -+ -+ def release(self): -+ with self._lock: -+ self.log.info("Releasing cluster lock for domain %s", self._sdUUID) -+ -+ try: -+ sanlock.release(self._sdUUID, SDM_LEASE_NAME, -+ [(self._leasesPath, SDM_LEASE_OFFSET)], -+ slkfd=SANLock._sanlock_fd) -+ except sanlock.SanlockException, e: -+ raise se.ReleaseLockFailure(self._sdUUID, e) -+ -+ self._sanlockfd = None -+ self.log.debug("Cluster lock for domain %s successfully released", -+ self._sdUUID) -diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py -index 62e9f74..8bbe3b8 100644 ---- a/vdsm/storage/hsm.py -+++ b/vdsm/storage/hsm.py -@@ -53,7 +53,7 @@ import iscsi - import misc - from misc import deprecated - import taskManager --import safelease -+import clusterlock - import storage_exception as se - from threadLocal import vars - from vdsm import constants -@@ -528,7 +528,7 @@ class HSM: - - @public - def spmStart(self, spUUID, prevID, prevLVER, recoveryMode, scsiFencing, -- maxHostID=safelease.MAX_HOST_ID, domVersion=None, -+ maxHostID=clusterlock.MAX_HOST_ID, domVersion=None, - options=None): - """ - Starts an SPM. -@@ -845,7 +845,7 @@ class HSM: - :raises: an :exc:`Storage_Exception.InvalidParameterException` if the - master domain is not supplied in the domain list. - """ -- safeLease = sd.packLeaseParams( -+ leaseParams = sd.packLeaseParams( - lockRenewalIntervalSec=lockRenewalIntervalSec, - leaseTimeSec=leaseTimeSec, - ioOpTimeoutSec=ioOpTimeoutSec, -@@ -853,9 +853,9 @@ class HSM: - vars.task.setDefaultException( - se.StoragePoolCreationError( - "spUUID=%s, poolName=%s, masterDom=%s, domList=%s, " -- "masterVersion=%s, safelease params: (%s)" % -+ "masterVersion=%s, clusterlock params: (%s)" % - (spUUID, poolName, masterDom, domList, masterVersion, -- safeLease))) -+ leaseParams))) - misc.validateUUID(spUUID, 'spUUID') - if masterDom not in domList: - raise se.InvalidParameterException("masterDom", str(masterDom)) -@@ -892,7 +892,7 @@ class HSM: - - return sp.StoragePool( - spUUID, self.taskMng).create(poolName, masterDom, domList, -- masterVersion, safeLease) -+ masterVersion, leaseParams) - - @public - def connectStoragePool(self, spUUID, hostID, scsiKey, -@@ -1701,7 +1701,7 @@ class HSM: - :returns: Nothing ? pool.reconstructMaster return nothing - :rtype: ? - """ -- safeLease = sd.packLeaseParams( -+ leaseParams = sd.packLeaseParams( - lockRenewalIntervalSec=lockRenewalIntervalSec, - leaseTimeSec=leaseTimeSec, - ioOpTimeoutSec=ioOpTimeoutSec, -@@ -1710,9 +1710,9 @@ class HSM: - - vars.task.setDefaultException( - se.ReconstructMasterError( -- "spUUID=%s, masterDom=%s, masterVersion=%s, safelease " -+ "spUUID=%s, masterDom=%s, masterVersion=%s, clusterlock " - "params: (%s)" % (spUUID, masterDom, masterVersion, -- safeLease))) -+ leaseParams))) - - self.log.info("spUUID=%s master=%s", spUUID, masterDom) - -@@ -1738,7 +1738,7 @@ class HSM: - domDict[d] = sd.validateSDDeprecatedStatus(status) - - return pool.reconstructMaster(hostId, poolName, masterDom, domDict, -- masterVersion, safeLease) -+ masterVersion, leaseParams) - - def _logResp_getDeviceList(self, response): - logableDevs = deepcopy(response) -diff --git a/vdsm/storage/imageRepository/formatConverter.py b/vdsm/storage/imageRepository/formatConverter.py -index 88b053d..0742560 100644 ---- a/vdsm/storage/imageRepository/formatConverter.py -+++ b/vdsm/storage/imageRepository/formatConverter.py -@@ -26,7 +26,7 @@ from vdsm import qemuImg - from storage import sd - from storage import blockSD - from storage import image --from storage import safelease -+from storage import clusterlock - from storage import volume - from storage import blockVolume - from storage import storage_exception as se -@@ -115,8 +115,8 @@ def v3DomainConverter(repoPath, hostId, domain, isMsd): - domain.setMetadataPermissions() - - log.debug("Initializing the new cluster lock for domain %s", domain.sdUUID) -- newClusterLock = safelease.SANLock(domain.sdUUID, domain.getIdsFilePath(), -- domain.getLeasesFilePath()) -+ newClusterLock = clusterlock.SANLock( -+ domain.sdUUID, domain.getIdsFilePath(), domain.getLeasesFilePath()) - newClusterLock.initLock() - - log.debug("Acquiring the host id %s for domain %s", hostId, domain.sdUUID) -diff --git a/vdsm/storage/safelease.py b/vdsm/storage/safelease.py -deleted file mode 100644 -index 88a4eae..0000000 ---- a/vdsm/storage/safelease.py -+++ /dev/null -@@ -1,250 +0,0 @@ --# --# Copyright 2011 Red 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 --# -- --import os --from vdsm.config import config --import misc --import subprocess --import sanlock --from contextlib import nested --from vdsm import constants --import storage_exception as se --import threading --import logging -- -- --MAX_HOST_ID = 250 -- --# The LEASE_OFFSET is used by SANLock to not overlap with safelease in --# orfer to preserve the ability to acquire both locks (e.g.: during the --# domain upgrade) --SDM_LEASE_NAME = 'SDM' --SDM_LEASE_OFFSET = 512 * 2048 -- -- --class ClusterLock(object): -- log = logging.getLogger("ClusterLock") -- lockUtilPath = config.get('irs', 'lock_util_path') -- lockCmd = config.get('irs', 'lock_cmd') -- freeLockCmd = config.get('irs', 'free_lock_cmd') -- -- def __init__(self, sdUUID, idFile, leaseFile, -- lockRenewalIntervalSec, -- leaseTimeSec, -- leaseFailRetry, -- ioOpTimeoutSec): -- self._lock = threading.RLock() -- self._sdUUID = sdUUID -- self._leaseFile = leaseFile -- self.setParams(lockRenewalIntervalSec, leaseTimeSec, -- leaseFailRetry, ioOpTimeoutSec) -- -- def initLock(self): -- lockUtil = os.path.join(self.lockUtilPath, "safelease") -- initCommand = [lockUtil, "release", "-f", self._leaseFile, "0"] -- rc, out, err = misc.execCmd(initCommand, sudo=False, -- cwd=self.lockUtilPath) -- if rc != 0: -- self.log.warn("could not initialise spm lease (%s): %s", rc, out) -- raise se.ClusterLockInitError() -- -- def setParams(self, lockRenewalIntervalSec, -- leaseTimeSec, -- leaseFailRetry, -- ioOpTimeoutSec): -- self._lockRenewalIntervalSec = lockRenewalIntervalSec -- self._leaseTimeSec = leaseTimeSec -- self._leaseFailRetry = leaseFailRetry -- self._ioOpTimeoutSec = ioOpTimeoutSec -- -- def getReservedId(self): -- return 1000 -- -- def acquireHostId(self, hostId, async): -- pass -- -- def releaseHostId(self, hostId, async, unused): -- pass -- -- def hasHostId(self, hostId): -- return True -- -- def acquire(self, hostID): -- leaseTimeMs = self._leaseTimeSec * 1000 -- ioOpTimeoutMs = self._ioOpTimeoutSec * 1000 -- with self._lock: -- self.log.debug("Acquiring cluster lock for domain %s" % -- self._sdUUID) -- -- lockUtil = self.getLockUtilFullPath() -- acquireLockCommand = subprocess.list2cmdline([lockUtil, "start", -- self._sdUUID, str(hostID), str(self._lockRenewalIntervalSec), -- str(self._leaseFile), str(leaseTimeMs), str(ioOpTimeoutMs), -- str(self._leaseFailRetry)]) -- -- cmd = [constants.EXT_SETSID, constants.EXT_IONICE, '-c1', '-n0', -- constants.EXT_SU, misc.IOUSER, '-s', constants.EXT_SH, '-c', -- acquireLockCommand] -- (rc, out, err) = misc.execCmd(cmd, cwd=self.lockUtilPath, -- sudo=True) -- if rc != 0: -- raise se.AcquireLockFailure(self._sdUUID, rc, out, err) -- self.log.debug("Clustered lock acquired successfully") -- -- def getLockUtilFullPath(self): -- return os.path.join(self.lockUtilPath, self.lockCmd) -- -- def release(self): -- with self._lock: -- freeLockUtil = os.path.join(self.lockUtilPath, self.freeLockCmd) -- releaseLockCommand = [freeLockUtil, self._sdUUID] -- self.log.info("Releasing cluster lock for domain %s" % -- self._sdUUID) -- (rc, out, err) = misc.execCmd(releaseLockCommand, sudo=False, -- cwd=self.lockUtilPath) -- if rc != 0: -- self.log.error("Could not release cluster lock " -- "rc=%s out=%s, err=%s" % (str(rc), out, err)) -- -- self.log.debug("Cluster lock released successfully") -- -- --class SANLock(object): -- log = logging.getLogger("SANLock") -- -- _sanlock_fd = None -- _sanlock_lock = threading.Lock() -- -- def __init__(self, sdUUID, idsPath, leasesPath, *args): -- self._lock = threading.Lock() -- self._sdUUID = sdUUID -- self._idsPath = idsPath -- self._leasesPath = leasesPath -- self._sanlockfd = None -- -- def initLock(self): -- try: -- sanlock.init_lockspace(self._sdUUID, self._idsPath) -- sanlock.init_resource(self._sdUUID, SDM_LEASE_NAME, -- [(self._leasesPath, SDM_LEASE_OFFSET)]) -- except sanlock.SanlockException: -- self.log.warn("Cannot initialize clusterlock", exc_info=True) -- raise se.ClusterLockInitError() -- -- def setParams(self, *args): -- pass -- -- def getReservedId(self): -- return MAX_HOST_ID -- -- def acquireHostId(self, hostId, async): -- with self._lock: -- self.log.info("Acquiring host id for domain %s (id: %s)", -- self._sdUUID, hostId) -- -- try: -- sanlock.add_lockspace(self._sdUUID, hostId, self._idsPath, -- async=async) -- except sanlock.SanlockException, e: -- if e.errno == os.errno.EINPROGRESS: -- # if the request is not asynchronous wait for the ongoing -- # lockspace operation to complete -- if not async and not sanlock.inq_lockspace( -- self._sdUUID, hostId, self._idsPath, wait=True): -- raise se.AcquireHostIdFailure(self._sdUUID, e) -- # else silently continue, the host id has been acquired -- # or it's in the process of being acquired (async) -- elif e.errno != os.errno.EEXIST: -- raise se.AcquireHostIdFailure(self._sdUUID, e) -- -- self.log.debug("Host id for domain %s successfully acquired " -- "(id: %s)", self._sdUUID, hostId) -- -- def releaseHostId(self, hostId, async, unused): -- with self._lock: -- self.log.info("Releasing host id for domain %s (id: %s)", -- self._sdUUID, hostId) -- -- try: -- sanlock.rem_lockspace(self._sdUUID, hostId, self._idsPath, -- async=async, unused=unused) -- except sanlock.SanlockException, e: -- if e.errno != os.errno.ENOENT: -- raise se.ReleaseHostIdFailure(self._sdUUID, e) -- -- self.log.debug("Host id for domain %s released successfully " -- "(id: %s)", self._sdUUID, hostId) -- -- def hasHostId(self, hostId): -- with self._lock: -- try: -- return sanlock.inq_lockspace(self._sdUUID, -- hostId, self._idsPath) -- except sanlock.SanlockException: -- self.log.debug("Unable to inquire sanlock lockspace " -- "status, returning False", exc_info=True) -- return False -- -- # The hostId parameter is maintained here only for compatibility with -- # ClusterLock. We could consider to remove it in the future but keeping it -- # for logging purpose is desirable. -- def acquire(self, hostId): -- with nested(self._lock, SANLock._sanlock_lock): -- self.log.info("Acquiring cluster lock for domain %s (id: %s)", -- self._sdUUID, hostId) -- -- while True: -- if SANLock._sanlock_fd is None: -- try: -- SANLock._sanlock_fd = sanlock.register() -- except sanlock.SanlockException, e: -- raise se.AcquireLockFailure(self._sdUUID, e.errno, -- "Cannot register to sanlock", str(e)) -- -- try: -- sanlock.acquire(self._sdUUID, SDM_LEASE_NAME, -- [(self._leasesPath, SDM_LEASE_OFFSET)], -- slkfd=SANLock._sanlock_fd) -- except sanlock.SanlockException, e: -- if e.errno != os.errno.EPIPE: -- raise se.AcquireLockFailure(self._sdUUID, e.errno, -- "Cannot acquire cluster lock", str(e)) -- SANLock._sanlock_fd = None -- continue -- -- break -- -- self.log.debug("Cluster lock for domain %s successfully acquired " -- "(id: %s)", self._sdUUID, hostId) -- -- def release(self): -- with self._lock: -- self.log.info("Releasing cluster lock for domain %s", self._sdUUID) -- -- try: -- sanlock.release(self._sdUUID, SDM_LEASE_NAME, -- [(self._leasesPath, SDM_LEASE_OFFSET)], -- slkfd=SANLock._sanlock_fd) -- except sanlock.SanlockException, e: -- raise se.ReleaseLockFailure(self._sdUUID, e) -- -- self._sanlockfd = None -- self.log.debug("Cluster lock for domain %s successfully released", -- self._sdUUID) -diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py -index 1b11017..dbc1beb 100644 ---- a/vdsm/storage/sd.py -+++ b/vdsm/storage/sd.py -@@ -31,7 +31,7 @@ import resourceFactories - from resourceFactories import IMAGE_NAMESPACE, VOLUME_NAMESPACE - import resourceManager as rm - from vdsm import constants --import safelease -+import clusterlock - import outOfProcess as oop - from persistentDict import unicodeEncoder, unicodeDecoder - -@@ -307,12 +307,12 @@ class StorageDomain: - DEFAULT_LEASE_PARAMS[DMDK_LEASE_TIME_SEC], - DEFAULT_LEASE_PARAMS[DMDK_LEASE_RETRIES], - DEFAULT_LEASE_PARAMS[DMDK_IO_OP_TIMEOUT_SEC]) -- self._clusterLock = safelease.ClusterLock(self.sdUUID, -- self.getIdsFilePath(), self.getLeasesFilePath(), -- *leaseParams) -+ self._clusterLock = clusterlock.SafeLease( -+ self.sdUUID, self.getIdsFilePath(), self.getLeasesFilePath(), -+ *leaseParams) - elif domversion in DOM_SANLOCK_VERS: -- self._clusterLock = safelease.SANLock(self.sdUUID, -- self.getIdsFilePath(), self.getLeasesFilePath()) -+ self._clusterLock = clusterlock.SANLock( -+ self.sdUUID, self.getIdsFilePath(), self.getLeasesFilePath()) - else: - raise se.UnsupportedDomainVersion(domversion) - -diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py -index 40d15b3..e13d088 100644 ---- a/vdsm/storage/sp.py -+++ b/vdsm/storage/sp.py -@@ -494,7 +494,7 @@ class StoragePool(Securable): - return config.getint("irs", "maximum_domains_in_pool") - - @unsecured -- def _acquireTemporaryClusterLock(self, msdUUID, safeLease): -+ def _acquireTemporaryClusterLock(self, msdUUID, leaseParams): - try: - # Master domain is unattached and all changes to unattached domains - # must be performed under storage lock -@@ -504,7 +504,7 @@ class StoragePool(Securable): - # assigned id for this pool - self.id = msd.getReservedId() - -- msd.changeLeaseParams(safeLease) -+ msd.changeLeaseParams(leaseParams) - - msd.acquireHostId(self.id) - -@@ -527,7 +527,7 @@ class StoragePool(Securable): - self.id = SPM_ID_FREE - - @unsecured -- def create(self, poolName, msdUUID, domList, masterVersion, safeLease): -+ def create(self, poolName, msdUUID, domList, masterVersion, leaseParams): - """ - Create new storage pool with single/multiple image data domain. - The command will create new storage pool meta-data attach each -@@ -537,10 +537,9 @@ class StoragePool(Securable): - 'msdUUID' - master domain of this pool (one of domList) - 'domList' - list of domains (i.e sdUUID,sdUUID,...,sdUUID) - """ -- self.log.info("spUUID=%s poolName=%s master_sd=%s " -- "domList=%s masterVersion=%s %s", -- self.spUUID, poolName, msdUUID, -- domList, masterVersion, str(safeLease)) -+ self.log.info("spUUID=%s poolName=%s master_sd=%s domList=%s " -+ "masterVersion=%s %s", self.spUUID, poolName, msdUUID, -+ domList, masterVersion, leaseParams) - - if msdUUID not in domList: - raise se.InvalidParameterException("masterDomain", msdUUID) -@@ -565,7 +564,7 @@ class StoragePool(Securable): - raise se.StorageDomainAlreadyAttached(spUUIDs[0], sdUUID) - - fileUtils.createdir(self.poolPath) -- self._acquireTemporaryClusterLock(msdUUID, safeLease) -+ self._acquireTemporaryClusterLock(msdUUID, leaseParams) - - try: - self._setSafe() -@@ -573,7 +572,7 @@ class StoragePool(Securable): - # We should do it before actually attaching this domain to the pool. - # During 'master' marking we create pool metadata and each attached - # domain should register there -- self.createMaster(poolName, msd, masterVersion, safeLease) -+ self.createMaster(poolName, msd, masterVersion, leaseParams) - self.__rebuild(msdUUID=msdUUID, masterVersion=masterVersion) - # Attach storage domains to the storage pool - # Since we are creating the pool then attach is done from the hsm and not the spm -@@ -722,10 +721,10 @@ class StoragePool(Securable): - - @unsecured - def reconstructMaster(self, hostId, poolName, msdUUID, domDict, -- masterVersion, safeLease): -+ masterVersion, leaseParams): - self.log.info("spUUID=%s hostId=%s poolName=%s msdUUID=%s domDict=%s " - "masterVersion=%s leaseparams=(%s)", self.spUUID, hostId, -- poolName, msdUUID, domDict, masterVersion, str(safeLease)) -+ poolName, msdUUID, domDict, masterVersion, leaseParams) - - if msdUUID not in domDict: - raise se.InvalidParameterException("masterDomain", msdUUID) -@@ -736,7 +735,7 @@ class StoragePool(Securable): - # For backward compatibility we must support a reconstructMaster - # that doesn't specify an hostId. - if not hostId: -- self._acquireTemporaryClusterLock(msdUUID, safeLease) -+ self._acquireTemporaryClusterLock(msdUUID, leaseParams) - temporaryLock = True - else: - # Forcing to acquire the host id (if it's not acquired already). -@@ -749,7 +748,7 @@ class StoragePool(Securable): - - try: - self.createMaster(poolName, futureMaster, masterVersion, -- safeLease) -+ leaseParams) - - for sdUUID in domDict: - domDict[sdUUID] = domDict[sdUUID].capitalize() --- -1.8.1 - diff --git a/0021-domain-select-the-cluster-lock-using-makeClusterLock.patch b/0021-domain-select-the-cluster-lock-using-makeClusterLock.patch deleted file mode 100644 index 3d0666c..0000000 --- a/0021-domain-select-the-cluster-lock-using-makeClusterLock.patch +++ /dev/null @@ -1,151 +0,0 @@ -From 5da363f0412d2b709fb1460324ee04b5905e492b Mon Sep 17 00:00:00 2001 -From: Federico Simoncelli -Date: Thu, 20 Dec 2012 06:12:52 -0500 -Subject: [PATCH 21/22] domain: select the cluster lock using makeClusterLock - -In order to support different locking mechanisms (not only per-domain -format but also per-domain type) a new makeClusterLock method has been -introduced to select the appropriate cluster lock. - -Change-Id: I78072254441335a420292af642985840e9b2ac68 -Signed-off-by: Federico Simoncelli -Reviewed-on: http://gerrit.ovirt.org/10281 -Reviewed-by: Allon Mureinik -Reviewed-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/11464 ---- - vdsm/storage/imageRepository/formatConverter.py | 11 +++-- - vdsm/storage/sd.py | 54 +++++++++++++++---------- - 2 files changed, 39 insertions(+), 26 deletions(-) - -diff --git a/vdsm/storage/imageRepository/formatConverter.py b/vdsm/storage/imageRepository/formatConverter.py -index 0742560..95a77d1 100644 ---- a/vdsm/storage/imageRepository/formatConverter.py -+++ b/vdsm/storage/imageRepository/formatConverter.py -@@ -26,7 +26,6 @@ from vdsm import qemuImg - from storage import sd - from storage import blockSD - from storage import image --from storage import clusterlock - from storage import volume - from storage import blockVolume - from storage import storage_exception as se -@@ -91,7 +90,12 @@ def v2DomainConverter(repoPath, hostId, domain, isMsd): - - def v3DomainConverter(repoPath, hostId, domain, isMsd): - log = logging.getLogger('Storage.v3DomainConverter') -- log.debug("Starting conversion for domain %s", domain.sdUUID) -+ -+ targetVersion = 3 -+ currentVersion = domain.getVersion() -+ -+ log.debug("Starting conversion for domain %s from version %s " -+ "to version %s", domain.sdUUID, currentVersion, targetVersion) - - targetVersion = 3 - currentVersion = domain.getVersion() -@@ -115,8 +119,7 @@ def v3DomainConverter(repoPath, hostId, domain, isMsd): - domain.setMetadataPermissions() - - log.debug("Initializing the new cluster lock for domain %s", domain.sdUUID) -- newClusterLock = clusterlock.SANLock( -- domain.sdUUID, domain.getIdsFilePath(), domain.getLeasesFilePath()) -+ newClusterLock = domain._makeClusterLock(targetVersion) - newClusterLock.initLock() - - log.debug("Acquiring the host id %s for domain %s", hostId, domain.sdUUID) -diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py -index dbc1beb..a55ce06 100644 ---- a/vdsm/storage/sd.py -+++ b/vdsm/storage/sd.py -@@ -101,10 +101,6 @@ BACKUP_DOMAIN = 3 - DOMAIN_CLASSES = {DATA_DOMAIN: 'Data', ISO_DOMAIN: 'Iso', - BACKUP_DOMAIN: 'Backup'} - --# Lock Version --DOM_SAFELEASE_VERS = (0, 2) --DOM_SANLOCK_VERS = (3,) -- - # Metadata keys - DMDK_VERSION = "VERSION" - DMDK_SDUUID = "SDUUID" -@@ -292,29 +288,20 @@ class StorageDomain: - mdBackupVersions = config.get('irs', 'md_backup_versions') - mdBackupDir = config.get('irs', 'md_backup_dir') - -+ # version: (clusterLockClass, hasVolumeLeases) -+ _clusterLockTable = { -+ 0: (clusterlock.SafeLease, False), -+ 2: (clusterlock.SafeLease, False), -+ 3: (clusterlock.SANLock, True), -+ } -+ - def __init__(self, sdUUID, domaindir, metadata): - self.sdUUID = sdUUID - self.domaindir = domaindir - self._metadata = metadata - self._lock = threading.Lock() - self.stat = None -- -- domversion = self.getVersion() -- -- if domversion in DOM_SAFELEASE_VERS: -- leaseParams = ( -- DEFAULT_LEASE_PARAMS[DMDK_LOCK_RENEWAL_INTERVAL_SEC], -- DEFAULT_LEASE_PARAMS[DMDK_LEASE_TIME_SEC], -- DEFAULT_LEASE_PARAMS[DMDK_LEASE_RETRIES], -- DEFAULT_LEASE_PARAMS[DMDK_IO_OP_TIMEOUT_SEC]) -- self._clusterLock = clusterlock.SafeLease( -- self.sdUUID, self.getIdsFilePath(), self.getLeasesFilePath(), -- *leaseParams) -- elif domversion in DOM_SANLOCK_VERS: -- self._clusterLock = clusterlock.SANLock( -- self.sdUUID, self.getIdsFilePath(), self.getLeasesFilePath()) -- else: -- raise se.UnsupportedDomainVersion(domversion) -+ self._clusterLock = self._makeClusterLock() - - def __del__(self): - if self.stat: -@@ -328,6 +315,25 @@ class StorageDomain: - def oop(self): - return oop.getProcessPool(self.sdUUID) - -+ def _makeClusterLock(self, domVersion=None): -+ if not domVersion: -+ domVersion = self.getVersion() -+ -+ leaseParams = ( -+ DEFAULT_LEASE_PARAMS[DMDK_LOCK_RENEWAL_INTERVAL_SEC], -+ DEFAULT_LEASE_PARAMS[DMDK_LEASE_TIME_SEC], -+ DEFAULT_LEASE_PARAMS[DMDK_LEASE_RETRIES], -+ DEFAULT_LEASE_PARAMS[DMDK_IO_OP_TIMEOUT_SEC], -+ ) -+ -+ try: -+ clusterLockClass = self._clusterLockTable[domVersion][0] -+ except KeyError: -+ raise se.UnsupportedDomainVersion(domVersion) -+ -+ return clusterLockClass(self.sdUUID, self.getIdsFilePath(), -+ self.getLeasesFilePath(), *leaseParams) -+ - @classmethod - def create(cls, sdUUID, domainName, domClass, typeSpecificArg, version): - """ -@@ -436,7 +442,11 @@ class StorageDomain: - return self._clusterLock.hasHostId(hostId) - - def hasVolumeLeases(self): -- return self.getVersion() in DOM_SANLOCK_VERS -+ domVersion = self.getVersion() -+ try: -+ return self._clusterLockTable[domVersion][1] -+ except KeyError: -+ raise se.UnsupportedDomainVersion(domVersion) - - def getVolumeLease(self, volUUID): - """ --- -1.8.1 - diff --git a/0022-clusterlock-add-the-local-locking-implementation.patch b/0022-clusterlock-add-the-local-locking-implementation.patch deleted file mode 100644 index d496718..0000000 --- a/0022-clusterlock-add-the-local-locking-implementation.patch +++ /dev/null @@ -1,225 +0,0 @@ -From e73c5bc586d1e689fc33ba77082488d755e3a621 Mon Sep 17 00:00:00 2001 -From: Federico Simoncelli -Date: Thu, 20 Dec 2012 08:08:21 -0500 -Subject: [PATCH 22/22] clusterlock: add the local locking implementation - -In order to have a faster and more lightweight locking mechanism on -local storage domains a new cluster lock (based on flock) has been -introduced. - -Change-Id: I106618a9a61cc96727edaf2e3ab043b2ec28ebe1 -Signed-off-by: Federico Simoncelli -Reviewed-on: http://gerrit.ovirt.org/10282 -Reviewed-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/11465 ---- - vdsm/storage/clusterlock.py | 122 +++++++++++++++++++++++++++++++++++++++++--- - vdsm/storage/localFsSD.py | 7 +++ - vdsm/storage/misc.py | 19 +++++++ - 3 files changed, 141 insertions(+), 7 deletions(-) - -diff --git a/vdsm/storage/clusterlock.py b/vdsm/storage/clusterlock.py -index 4525b2f..cabf174 100644 ---- a/vdsm/storage/clusterlock.py -+++ b/vdsm/storage/clusterlock.py -@@ -19,6 +19,7 @@ - # - - import os -+import fcntl - import threading - import logging - import subprocess -@@ -127,6 +128,22 @@ class SafeLease(object): - self.log.debug("Cluster lock released successfully") - - -+initSANLockLog = logging.getLogger("initSANLock") -+ -+ -+def initSANLock(sdUUID, idsPath, leasesPath): -+ initSANLockLog.debug("Initializing SANLock for domain %s", sdUUID) -+ -+ try: -+ sanlock.init_lockspace(sdUUID, idsPath) -+ sanlock.init_resource(sdUUID, SDM_LEASE_NAME, -+ [(leasesPath, SDM_LEASE_OFFSET)]) -+ except sanlock.SanlockException: -+ initSANLockLog.error("Cannot initialize SANLock for domain %s", -+ sdUUID, exc_info=True) -+ raise se.ClusterLockInitError() -+ -+ - class SANLock(object): - log = logging.getLogger("SANLock") - -@@ -141,13 +158,7 @@ class SANLock(object): - self._sanlockfd = None - - def initLock(self): -- try: -- sanlock.init_lockspace(self._sdUUID, self._idsPath) -- sanlock.init_resource(self._sdUUID, SDM_LEASE_NAME, -- [(self._leasesPath, SDM_LEASE_OFFSET)]) -- except sanlock.SanlockException: -- self.log.warn("Cannot initialize clusterlock", exc_info=True) -- raise se.ClusterLockInitError() -+ initSANLock(self._sdUUID, self._idsPath, self._leasesPath) - - def setParams(self, *args): - pass -@@ -249,3 +260,100 @@ class SANLock(object): - self._sanlockfd = None - self.log.debug("Cluster lock for domain %s successfully released", - self._sdUUID) -+ -+ -+class LocalLock(object): -+ log = logging.getLogger("LocalLock") -+ -+ _globalLockMap = {} -+ _globalLockMapSync = threading.Lock() -+ -+ def __init__(self, sdUUID, idsPath, leasesPath, *args): -+ self._sdUUID = sdUUID -+ self._idsPath = idsPath -+ self._leasesPath = leasesPath -+ -+ def initLock(self): -+ # The LocalLock initialization is based on SANLock to maintain on-disk -+ # domain format consistent across all the V3 types. -+ # The advantage is that the domain can be exposed as an NFS/GlusterFS -+ # domain later on without any modification. -+ # XXX: Keep in mind that LocalLock and SANLock cannot detect each other -+ # and therefore concurrently using the same domain as local domain and -+ # NFS domain (or any other shared file-based domain) will certainly -+ # lead to disastrous consequences. -+ initSANLock(self._sdUUID, self._idsPath, self._leasesPath) -+ -+ def setParams(self, *args): -+ pass -+ -+ def getReservedId(self): -+ return MAX_HOST_ID -+ -+ def acquireHostId(self, hostId, async): -+ self.log.debug("Host id for domain %s successfully acquired (id: %s)", -+ self._sdUUID, hostId) -+ -+ def releaseHostId(self, hostId, async, unused): -+ self.log.debug("Host id for domain %s released successfully (id: %s)", -+ self._sdUUID, hostId) -+ -+ def hasHostId(self, hostId): -+ return True -+ -+ def acquire(self, hostId): -+ with self._globalLockMapSync: -+ self.log.info("Acquiring local lock for domain %s (id: %s)", -+ self._sdUUID, hostId) -+ -+ lockFile = self._globalLockMap.get(self._sdUUID, None) -+ -+ if lockFile: -+ try: -+ misc.NoIntrCall(fcntl.fcntl, lockFile, fcntl.F_GETFD) -+ except IOError as e: -+ # We found a stale file descriptor, removing. -+ del self._globalLockMap[self._sdUUID] -+ -+ # Raise any other unkown error. -+ if e.errno != os.errno.EBADF: -+ raise -+ else: -+ self.log.debug("Local lock already acquired for domain " -+ "%s (id: %s)", self._sdUUID, hostId) -+ return # success, the lock was already acquired -+ -+ lockFile = misc.NoIntrCall(os.open, self._idsPath, os.O_RDONLY) -+ -+ try: -+ misc.NoIntrCall(fcntl.flock, lockFile, -+ fcntl.LOCK_EX | fcntl.LOCK_NB) -+ except IOError as e: -+ misc.NoIntrCall(os.close, lockFile) -+ if e.errno in (os.errno.EACCES, os.errno.EAGAIN): -+ raise se.AcquireLockFailure( -+ self._sdUUID, e.errno, "Cannot acquire local lock", -+ str(e)) -+ raise -+ else: -+ self._globalLockMap[self._sdUUID] = lockFile -+ -+ self.log.debug("Local lock for domain %s successfully acquired " -+ "(id: %s)", self._sdUUID, hostId) -+ -+ def release(self): -+ with self._globalLockMapSync: -+ self.log.info("Releasing local lock for domain %s", self._sdUUID) -+ -+ lockFile = self._globalLockMap.get(self._sdUUID, None) -+ -+ if not lockFile: -+ self.log.debug("Local lock already released for domain %s", -+ self._sdUUID) -+ return -+ -+ misc.NoIntrCall(os.close, lockFile) -+ del self._globalLockMap[self._sdUUID] -+ -+ self.log.debug("Local lock for domain %s successfully released", -+ self._sdUUID) -diff --git a/vdsm/storage/localFsSD.py b/vdsm/storage/localFsSD.py -index 198c073..7d59894 100644 ---- a/vdsm/storage/localFsSD.py -+++ b/vdsm/storage/localFsSD.py -@@ -26,9 +26,16 @@ import fileSD - import fileUtils - import storage_exception as se - import misc -+import clusterlock - - - class LocalFsStorageDomain(fileSD.FileStorageDomain): -+ # version: (clusterLockClass, hasVolumeLeases) -+ _clusterLockTable = { -+ 0: (clusterlock.SafeLease, False), -+ 2: (clusterlock.SafeLease, False), -+ 3: (clusterlock.LocalLock, True), -+ } - - @classmethod - def _preCreateValidation(cls, sdUUID, domPath, typeSpecificArg, version): -diff --git a/vdsm/storage/misc.py b/vdsm/storage/misc.py -index 17d38ee..b26a317 100644 ---- a/vdsm/storage/misc.py -+++ b/vdsm/storage/misc.py -@@ -1344,6 +1344,25 @@ def itmap(func, iterable, maxthreads=UNLIMITED_THREADS): - yield respQueue.get() - - -+def NoIntrCall(fun, *args, **kwargs): -+ """ -+ This wrapper is used to handle the interrupt exceptions that might -+ occur during a system call. -+ """ -+ while True: -+ try: -+ return fun(*args, **kwargs) -+ except (IOError, select.error) as e: -+ if e.args[0] == os.errno.EINTR: -+ continue -+ raise -+ break -+ -+ -+# NOTE: it would be best to try and unify NoIntrCall and NoIntrPoll. -+# We could do so defining a new object that can be used as a placeholer -+# for the changing timeout value in the *args/**kwargs. This would -+# lead us to rebuilding the function arguments at each loop. - def NoIntrPoll(pollfun, timeout=-1): - """ - This wrapper is used to handle the interrupt exceptions that might occur --- -1.8.1 - diff --git a/0023-upgrade-catch-MetaDataKeyNotFoundError-when-preparin.patch b/0023-upgrade-catch-MetaDataKeyNotFoundError-when-preparin.patch deleted file mode 100644 index cda48c4..0000000 --- a/0023-upgrade-catch-MetaDataKeyNotFoundError-when-preparin.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 94a3b6b63449ac4a16c76c1d5c52d58f5c895ecc Mon Sep 17 00:00:00 2001 -From: Lee Yarwood -Date: Tue, 22 Jan 2013 14:09:28 +0000 -Subject: [PATCH 23/27] upgrade: catch MetaDataKeyNotFoundError when preparing - images - -Ensure that we catch and continue past any MetaDataKeyNotFoundError -exception when preparing images that may contain partially removed -volumes. For example where the LV is still present but the metadata -block has been blanked out. - -Change-Id: I92f7a61bf6d1e24e84711486fd4f8ba67e2a0077 -Signed-off-by: Lee Yarwood -Reviewed-on: http://gerrit.ovirt.org/11485 -Reviewed-by: Federico Simoncelli ---- - vdsm/storage/imageRepository/formatConverter.py | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/vdsm/storage/imageRepository/formatConverter.py b/vdsm/storage/imageRepository/formatConverter.py -index 95a77d1..cbf64f5 100644 ---- a/vdsm/storage/imageRepository/formatConverter.py -+++ b/vdsm/storage/imageRepository/formatConverter.py -@@ -280,6 +280,11 @@ def v3DomainConverter(repoPath, hostId, domain, isMsd): - log.error("It is not possible to prepare the image %s, the " - "volume chain looks damaged", imgUUID, exc_info=True) - -+ except se.MetaDataKeyNotFoundError: -+ log.error("It is not possible to prepare the image %s, the " -+ "volume metadata looks damaged", imgUUID, -+ exc_info=True) -+ - finally: - try: - img.teardown(domain.sdUUID, imgUUID) --- -1.8.1 - diff --git a/0024-vdsm.spec-Require-openssl.patch b/0024-vdsm.spec-Require-openssl.patch deleted file mode 100644 index ab86511..0000000 --- a/0024-vdsm.spec-Require-openssl.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 53e8505e34f1e7a76adfa0de74d5eb9d27efd586 Mon Sep 17 00:00:00 2001 -From: Douglas Schilling Landgraf -Date: Wed, 30 Jan 2013 09:27:38 -0500 -Subject: [PATCH 24/27] vdsm.spec: Require openssl - -deployUtil uses openssl command, we should Require it. - -Change-Id: Ib53aa66bad94e9c4046f3430b892a60cbc80c520 -Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=905728 -Signed-off-by: Douglas Schilling Landgraf -Reviewed-on: http://gerrit.ovirt.org/11543 -Reviewed-by: Dan Kenigsberg ---- - vdsm.spec.in | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/vdsm.spec.in b/vdsm.spec.in -index 8ad4dce..e898c59 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -207,6 +207,7 @@ BuildArch: noarch - - Requires: %{name} = %{version}-%{release} - Requires: m2crypto -+Requires: openssl - - %description reg - VDSM registration package. Used to register a Linux host to a Virtualization --- -1.8.1 - diff --git a/0025-Fedora-18-require-a-newer-udev.patch b/0025-Fedora-18-require-a-newer-udev.patch deleted file mode 100644 index 6464c3f..0000000 --- a/0025-Fedora-18-require-a-newer-udev.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 674f1003f05d84609e4555c1509b1409475e1c97 Mon Sep 17 00:00:00 2001 -From: Dan Kenigsberg -Date: Tue, 29 Jan 2013 10:44:01 +0200 -Subject: [PATCH 25/27] Fedora 18: require a newer udev - -Due to https://bugzilla.redhat.com/903716 `udev: device node permissions -not applied with "change" event' we could not use block storage in -Fedora. Let us explicitly require a newerer systemd that fixes this -issue, to avoid users' dismay. - -Change-Id: Ie17abb2af146c492efafc94bfbb533c7f6c8025c -Signed-off-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/11489 -Reviewed-by: Antoni Segura Puimedon -Reviewed-by: Federico Simoncelli -Reviewed-on: http://gerrit.ovirt.org/11534 -Tested-by: Federico Simoncelli ---- - vdsm.spec.in | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/vdsm.spec.in b/vdsm.spec.in -index e898c59..00c1259 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -136,6 +136,7 @@ Requires: selinux-policy-targeted >= 3.11.1-71 - # In order to avoid a policycoreutils bug (rhbz 883355) when selinux is - # disabled we now require the version 2.1.13-44 (or newer) of Fedora. - Requires: policycoreutils >= 2.1.13-44 -+Requires: systemd >= 197-1.fc18.2 - %endif - - Requires: libvirt-python, libvirt-lock-sanlock, libvirt-client --- -1.8.1 - diff --git a/0026-fix-sloppy-backport-of-safelease-rename.patch b/0026-fix-sloppy-backport-of-safelease-rename.patch deleted file mode 100644 index 8ae6b1e..0000000 --- a/0026-fix-sloppy-backport-of-safelease-rename.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 7904843648c7dd368f832d8f2b652290ca717424 Mon Sep 17 00:00:00 2001 -From: Dan Kenigsberg -Date: Wed, 30 Jan 2013 13:43:33 +0200 -Subject: [PATCH 26/27] fix sloppy backport of safelease rename - -Somehow, this sloppy backport of I74070ebb43dd726362900a0746c -was not caught by Jenkins. Any idea why? - -Change-Id: Iaf1dc264d17b59934b78877a11f37b21614b268e -Signed-off-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/11544 -Reviewed-by: Douglas Schilling Landgraf -Reviewed-by: Federico Simoncelli ---- - Makefile.am | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile.am b/Makefile.am -index 80d6f52..06ffbf9 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -54,6 +54,7 @@ PEP8_WHITELIST = \ - vdsm/*.py.in \ - vdsm/storage/__init__.py \ - vdsm/storage/blockVolume.py \ -+ vdsm/storage/clusterlock.py \ - vdsm/storage/devicemapper.py \ - vdsm/storage/domainMonitor.py \ - vdsm/storage/fileSD.py \ -@@ -74,7 +75,6 @@ PEP8_WHITELIST = \ - vdsm/storage/persistentDict.py \ - vdsm/storage/remoteFileHandler.py \ - vdsm/storage/resourceFactories.py \ -- vdsm/storage/safelease.py \ - vdsm/storage/sd.py \ - vdsm/storage/sdc.py \ - vdsm/storage/securable.py \ --- -1.8.1 - diff --git a/0027-removing-the-use-of-zombie-reaper-from-supervdsm.patch b/0027-removing-the-use-of-zombie-reaper-from-supervdsm.patch deleted file mode 100644 index 14ce5fd..0000000 --- a/0027-removing-the-use-of-zombie-reaper-from-supervdsm.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 18c24f7c7c27ac732c4a760caa9524e7319cd47e Mon Sep 17 00:00:00 2001 -From: Yaniv Bronhaim -Date: Tue, 29 Jan 2013 13:49:46 +0200 -Subject: [PATCH 27/27] removing the use of zombie reaper from supervdsm - -This may solve validateAccess errors, but can cause defuct subprocesses. -This patch is signed as WIP until we'll find better solution, until then -this patch helps to verify if the previous errors that was caused thanks -to zombie reaper handling don't occur. - -Change-Id: If3f9bae47f2894cc95785de8f19f6ec388ea58da -Signed-off-by: Yaniv Bronhaim -Reviewed-on: http://gerrit.ovirt.org/11491 -Reviewed-by: Dan Kenigsberg -Reviewed-by: Federico Simoncelli -Tested-by: Federico Simoncelli ---- - vdsm/supervdsmServer.py | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py -index 833e91f..21e7c94 100755 ---- a/vdsm/supervdsmServer.py -+++ b/vdsm/supervdsmServer.py -@@ -56,7 +56,6 @@ import tc - import ksm - import mkimage - from storage.multipath import MPATH_CONF --import zombieReaper - - _UDEV_RULE_FILE_DIR = "/etc/udev/rules.d/" - _UDEV_RULE_FILE_PREFIX = "99-vdsm-" -@@ -199,7 +198,6 @@ class _SuperVdsm(object): - pipe, hisPipe = Pipe() - proc = Process(target=child, args=(hisPipe,)) - proc.start() -- zombieReaper.autoReapPID(proc.pid) - - if not pipe.poll(RUN_AS_TIMEOUT): - try: -@@ -391,8 +389,6 @@ def main(): - if os.path.exists(address): - os.unlink(address) - -- zombieReaper.registerSignalHandler() -- - log.debug("Setting up keep alive thread") - - monThread = threading.Thread(target=__pokeParent, --- -1.8.1 - diff --git a/0028-configNet-allow-delete-update-of-devices-with-no-ifc.patch b/0028-configNet-allow-delete-update-of-devices-with-no-ifc.patch deleted file mode 100644 index a85b5fc..0000000 --- a/0028-configNet-allow-delete-update-of-devices-with-no-ifc.patch +++ /dev/null @@ -1,63 +0,0 @@ -From c1465ed861233cf90a1cace4c41560cbd48a61b3 Mon Sep 17 00:00:00 2001 -From: Dan Kenigsberg -Date: Fri, 1 Feb 2013 23:04:50 +0200 -Subject: [PATCH 28/30] configNet: allow delete/update of devices with no ifcfg - -In Fedora 18, ifcfg files are missing by default. This patch assumes -that there are no custom MTU setting for a device with no ifcfg file. - -This version of the patch owes a lot to Mark Wu's -http://gerrit.ovirt.org/11357 and to Toni who convinced me that it is -better to read the MTU directly from kernel. - -Change-Id: Icb3a623ca3d3b560288cbe4141eea6bd060ac798 -Bug-Url: https://bugzilla.redhat.com/906383 -Signed-off-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/11621 -Reviewed-by: Antoni Segura Puimedon -Tested-by: Mike Kolesnik -Reviewed-on: http://gerrit.ovirt.org/11680 -Tested-by: Antoni Segura Puimedon ---- - vdsm/configNetwork.py | 18 +++++------------- - 1 file changed, 5 insertions(+), 13 deletions(-) - -diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py -index 53debfa..041e1a4 100755 ---- a/vdsm/configNetwork.py -+++ b/vdsm/configNetwork.py -@@ -600,12 +600,10 @@ class ConfigWriter(object): - it check if a vlan, bond that have a higher mtu value - """ - for nic in nics: -- cf = self.NET_CONF_PREF + nic -- mtuval = self._getConfigValue(cf, 'MTU') -- if not mtuval is None: -- mtuval = int(mtuval) -- if mtuval > mtu: -- mtu = mtuval -+ mtuval = int(netinfo.getMtu(nic)) -+ -+ if mtuval > mtu: -+ mtu = mtuval - return mtu - - def setNewMtu(self, network, bridged): -@@ -623,13 +621,7 @@ class ConfigWriter(object): - _netinfo = netinfo.NetInfo() - currmtu = None - if bridged: -- cf = self.NET_CONF_PREF + network -- currmtu = self._getConfigValue(cf, 'MTU') -- if currmtu: -- currmtu = int(currmtu) -- else: -- # Optimization: if network hasn't custom MTU, do nothing -- return -+ currmtu = int(netinfo.getMtu(network)) - - nics, delvlan, bonding = \ - _netinfo.getNicsVlanAndBondingForNetwork(network) --- -1.8.1.2 - diff --git a/0029-Requires-policycoreutils-2.1.13-55-to-avoid-another-.patch b/0029-Requires-policycoreutils-2.1.13-55-to-avoid-another-.patch deleted file mode 100644 index 83a40f6..0000000 --- a/0029-Requires-policycoreutils-2.1.13-55-to-avoid-another-.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 6c021fc54d446f944acd497fb7e2110428ac289c Mon Sep 17 00:00:00 2001 -From: Douglas Schilling Landgraf -Date: Tue, 5 Feb 2013 14:30:49 -0500 -Subject: [PATCH 29/30] Requires policycoreutils-2.1.13-55 to avoid another - break on selinux disabled. - -When selinux is disabled on f18, it fails to import module sepolicy -with an exception. It causes the the vdsm-tool unavailable, and therefore -the bonding module can't be loaded when vdsm starts up. For details, -please see https://bugzilla.redhat.com/show_bug.cgi?id=889698 - -Change-Id: I09387167ceeffdc104910103b8381954296cdbe9 -Signed-off-by: Mark Wu -Signed-off-by: Douglas Schilling Landgraf -Reviewed-on: http://gerrit.ovirt.org/11731 -Reviewed-by: Dan Kenigsberg -Tested-by: Dan Kenigsberg ---- - vdsm.spec.in | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/vdsm.spec.in b/vdsm.spec.in -index 00c1259..0aad124 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -133,9 +133,9 @@ Requires: lvm2 >= 2.02.95 - - %if 0%{?fedora} >= 18 - Requires: selinux-policy-targeted >= 3.11.1-71 --# In order to avoid a policycoreutils bug (rhbz 883355) when selinux is --# disabled we now require the version 2.1.13-44 (or newer) of Fedora. --Requires: policycoreutils >= 2.1.13-44 -+# In order to avoid a policycoreutils bug (rhbz 889698) when selinux is -+# disabled we now require the version 2.1.13-55 (or newer) of Fedora. -+Requires: policycoreutils >= 2.1.13-55 - Requires: systemd >= 197-1.fc18.2 - %endif - --- -1.8.1.2 - diff --git a/0030-After-fail-to-connect-to-supervdsm-more-than-3-time-.patch b/0030-After-fail-to-connect-to-supervdsm-more-than-3-time-.patch deleted file mode 100644 index 6f21182..0000000 --- a/0030-After-fail-to-connect-to-supervdsm-more-than-3-time-.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 73b120fd6d0cd8215f3857c034cc7d4584c8ee05 Mon Sep 17 00:00:00 2001 -From: Yaniv Bronhaim -Date: Thu, 14 Feb 2013 13:46:06 +0200 -Subject: [PATCH 30/30] After fail to connect to supervdsm more than 3 time - vdsm gets into panic - -Due to race between old supervdsm instance to the new instance after -prepareForShutdown, sometimes the socket is removed after -new supervdsm started to listen on it. -_pokeParent thread unlink the socket when distinguish that vdsm is dead. -This can take more time than the time that takes to vdsm to startup and -start the new instance of supervdsm. The unlink removes the socket file -and vdsm cannot communicate with supervdsm. -When the communication fails, vdsm calls panic and restart itself, this -will start supervdsm again as needed. - -Change-Id: Iafe112893a76686edd2949d4f40b734646fd74df -Bug-Id: https://bugzilla.redhat.com/show_bug.cgi?id=910005 -Signed-off-by: Yaniv Bronhaim -Reviewed-on: http://gerrit.ovirt.org/11932 -Reviewed-by: Saggi Mizrahi -Reviewed-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/12053 ---- - vdsm/supervdsm.py | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/vdsm/supervdsm.py b/vdsm/supervdsm.py -index 6a38076..1b6402d 100644 ---- a/vdsm/supervdsm.py -+++ b/vdsm/supervdsm.py -@@ -194,7 +194,14 @@ class SuperVdsmProxy(object): - def launch(self): - self._firstLaunch = False - self._start() -- utils.retry(self._connect, Exception, timeout=60) -+ try: -+ # We retry 3 times to connect to avoid exceptions that are raised -+ # due to the process initializing. It might takes time to create -+ # the communication socket or other initialization methods take -+ # more time than expected. -+ utils.retry(self._connect, Exception, timeout=60) -+ except: -+ misc.panic("Couldn't connect to supervdsm") - - def __getattr__(self, name): - return ProxyCaller(self, name) --- -1.8.1.2 - diff --git a/0031-packaging-add-load_needed_modules.py.in.patch b/0031-packaging-add-load_needed_modules.py.in.patch deleted file mode 100644 index 25fc677..0000000 --- a/0031-packaging-add-load_needed_modules.py.in.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 45fec93749f8474db30cb0b518ca9b2f7b80f142 Mon Sep 17 00:00:00 2001 -From: Federico Simoncelli -Date: Thu, 28 Feb 2013 10:44:49 +0100 -Subject: [PATCH 31/32] packaging: add load_needed_modules.py.in - -Signed-off-by: Federico Simoncelli ---- - vdsm-tool/load_needed_modules.py.in | 61 +++++++++++++++++++++++++++++++++++++ - 1 file changed, 61 insertions(+) - create mode 100644 vdsm-tool/load_needed_modules.py.in - -diff --git a/vdsm-tool/load_needed_modules.py.in b/vdsm-tool/load_needed_modules.py.in -new file mode 100644 -index 0000000..675a172 ---- /dev/null -+++ b/vdsm-tool/load_needed_modules.py.in -@@ -0,0 +1,61 @@ -+# Copyright IBM, Corp. 2012 -+# -+# 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 -+# -+ -+ -+import subprocess -+ -+from vdsm.tool import expose -+ -+ -+EX_MODPROBE = '@MODPROBE_PATH@' -+ -+ -+def _exec_command(argv): -+ """ -+ This function executes a given shell command. -+ """ -+ -+ p = subprocess.Popen(argv, stdout=subprocess.PIPE, -+ stderr=subprocess.PIPE) -+ out, err = p.communicate() -+ rc = p.returncode -+ if rc != 0: -+ raise Exception("Execute command %s failed: %s" % (argv, err)) -+ -+ -+def _enable_bond_dev(): -+ REQUIRED = set(['bond0', 'bond1', 'bond2', 'bond3', 'bond4']) -+ MASTER_FILE = '/sys/class/net/bonding_masters' -+ -+ # @ENGINENAME@ currently assumes that all bonding devices pre-exist -+ existing = set(file(MASTER_FILE).read().split()) -+ with open(MASTER_FILE, 'w') as f: -+ for bond in REQUIRED - existing: -+ f.write('+%s\n' % bond) -+ -+ -+@expose('load-needed-modules') -+def load_needed_modules(): -+ """ -+ Load needed modules -+ """ -+ -+ for mod in ['tun', 'bonding', '8021q']: -+ _exec_command([EX_MODPROBE, mod]) -+ _enable_bond_dev() --- -1.8.1.2 - diff --git a/0032-tool-_enable_bond_dev-reopen-bonding_masters-per-bon.patch b/0032-tool-_enable_bond_dev-reopen-bonding_masters-per-bon.patch deleted file mode 100644 index b73ce8b..0000000 --- a/0032-tool-_enable_bond_dev-reopen-bonding_masters-per-bon.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 8cca94da272babb5eef7a81a7a05d178070efe69 Mon Sep 17 00:00:00 2001 -From: Dan Kenigsberg -Date: Mon, 25 Feb 2013 16:06:56 +0200 -Subject: [PATCH 32/32] tool: _enable_bond_dev: reopen bonding_masters per bond - -Writing multiple +bondnames into /sys/class/net/bonding_masters is not -enough to add new bonding devices. One has to reopen that file for each -added bond. - -Change-Id: I4693a3d2cc3beba0b5961d16fb1ef25170f99f9e -Signed-off-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/12409 -Reviewed-by: Antoni Segura Puimedon -Tested-by: gena cher -Reviewed-on: http://gerrit.ovirt.org/12447 -Reviewed-by: Igor Lvovsky ---- - vdsm-tool/load_needed_modules.py.in | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/vdsm-tool/load_needed_modules.py.in b/vdsm-tool/load_needed_modules.py.in -index 675a172..89c2b3f 100644 ---- a/vdsm-tool/load_needed_modules.py.in -+++ b/vdsm-tool/load_needed_modules.py.in -@@ -45,8 +45,8 @@ def _enable_bond_dev(): - - # @ENGINENAME@ currently assumes that all bonding devices pre-exist - existing = set(file(MASTER_FILE).read().split()) -- with open(MASTER_FILE, 'w') as f: -- for bond in REQUIRED - existing: -+ for bond in REQUIRED - existing: -+ with open(MASTER_FILE, 'w') as f: - f.write('+%s\n' % bond) - - --- -1.8.1.2 - diff --git a/0033-gluster-Handling-Attribute-error-in-Python-2.6.patch b/0033-gluster-Handling-Attribute-error-in-Python-2.6.patch deleted file mode 100644 index 52909b2..0000000 --- a/0033-gluster-Handling-Attribute-error-in-Python-2.6.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 345374cfd88cc5bd1295d8e72c579edf3669ab1a Mon Sep 17 00:00:00 2001 -From: Aravinda VK -Date: Wed, 6 Mar 2013 14:34:12 +0530 -Subject: [PATCH 33/36] gluster: Handling Attribute error in Python 2.6 - -xml.etree.cElementTree in Python 2.6 doesn't have the attribute -ParseError(Introduced in Python 2.7). VDSM gluster/cli.py tries -to capture etree.ParseError when gluster cli returns incompatible -xml output. - -Change-Id: I63c33b34ce11473636365ea094e267c5424c7255 -Signed-off-by: Aravinda VK -(cherry picked from commit 5759c876e414b433b1a42e50e1817d5841ec2ef2) -Reviewed-on: http://gerrit.ovirt.org/12829 -Reviewed-by: Dan Kenigsberg ---- - vdsm/gluster/cli.py | 18 ++++++++++++------ - 1 file changed, 12 insertions(+), 6 deletions(-) - -diff --git a/vdsm/gluster/cli.py b/vdsm/gluster/cli.py -index 7136281..d4f65ab 100644 ---- a/vdsm/gluster/cli.py -+++ b/vdsm/gluster/cli.py -@@ -31,6 +31,12 @@ _glusterCommandPath = utils.CommandPath("gluster", - ) - - -+if hasattr(etree, 'ParseError'): -+ _etreeExceptions = (etree.ParseError, AttributeError, ValueError) -+else: -+ _etreeExceptions = (SyntaxError, AttributeError, ValueError) -+ -+ - def _getGlusterVolCmd(): - return [_glusterCommandPath.cmd, "--mode=script", "volume"] - -@@ -85,7 +91,7 @@ def _execGlusterXml(cmd): - tree = etree.fromstring('\n'.join(out)) - rv = int(tree.find('opRet').text) - msg = tree.find('opErrstr').text -- except (etree.ParseError, AttributeError, ValueError): -+ except _etreeExceptions: - raise ge.GlusterXmlErrorException(err=out) - if rv == 0: - return tree -@@ -303,7 +309,7 @@ def volumeStatus(volumeName, brick=None, option=None): - return _parseVolumeStatusMem(xmltree) - else: - return _parseVolumeStatus(xmltree) -- except (etree.ParseError, AttributeError, ValueError): -+ except _etreeExceptions: - raise ge.GlusterXmlErrorException(err=[etree.tostring(xmltree)]) - - -@@ -427,7 +433,7 @@ def volumeInfo(volumeName=None): - raise ge.GlusterVolumesListFailedException(rc=e.rc, err=e.err) - try: - return _parseVolumeInfo(xmltree) -- except (etree.ParseError, AttributeError, ValueError): -+ except _etreeExceptions: - raise ge.GlusterXmlErrorException(err=[etree.tostring(xmltree)]) - - -@@ -448,7 +454,7 @@ def volumeCreate(volumeName, brickList, replicaCount=0, stripeCount=0, - raise ge.GlusterVolumeCreateFailedException(rc=e.rc, err=e.err) - try: - return {'uuid': xmltree.find('volCreate/volume/id').text} -- except (etree.ParseError, AttributeError, ValueError): -+ except _etreeExceptions: - raise ge.GlusterXmlErrorException(err=[etree.tostring(xmltree)]) - - -@@ -787,7 +793,7 @@ def peerStatus(): - return _parsePeerStatus(xmltree, - _getLocalIpAddress() or _getGlusterHostName(), - _getGlusterUuid(), HostStatus.CONNECTED) -- except (etree.ParseError, AttributeError, ValueError): -+ except _etreeExceptions: - raise ge.GlusterXmlErrorException(err=[etree.tostring(xmltree)]) - - -@@ -878,5 +884,5 @@ def volumeProfileInfo(volumeName, nfs=False): - raise ge.GlusterVolumeProfileInfoFailedException(rc=e.rc, err=e.err) - try: - return _parseVolumeProfileInfo(xmltree, nfs) -- except (etree.ParseError, AttributeError, ValueError): -+ except _etreeExceptions: - raise ge.GlusterXmlErrorException(err=[etree.tostring(xmltree)]) --- -1.8.1.4 - diff --git a/0034-bootstrap-remove-glusterfs-packages.patch b/0034-bootstrap-remove-glusterfs-packages.patch deleted file mode 100644 index 8351336..0000000 --- a/0034-bootstrap-remove-glusterfs-packages.patch +++ /dev/null @@ -1,52 +0,0 @@ -From f2277d595e06d86791abffabe52f4e397f26cb0f Mon Sep 17 00:00:00 2001 -From: "Bala.FA" -Date: Tue, 6 Nov 2012 16:09:49 +0530 -Subject: [PATCH 34/36] bootstrap: remove glusterfs packages - -As glusterfs packages are dependencies for vdsm-gluster package, -having these in bootstrap is redundant - -Change-Id: I5bdde338599155df43af3a0fd0d14a02e3bddda8 -Signed-off-by: Bala.FA -Reviewed-on: http://gerrit.ovirt.org/12959 -Reviewed-by: Timothy Asir -Reviewed-by: Dan Kenigsberg -Reviewed-by: Douglas Schilling Landgraf ---- - vds_bootstrap/vds_bootstrap.py | 3 +-- - vdsm.spec.in | 5 ++++- - 2 files changed, 5 insertions(+), 3 deletions(-) - -diff --git a/vds_bootstrap/vds_bootstrap.py b/vds_bootstrap/vds_bootstrap.py -index 61e0f6f..219e6e4 100755 ---- a/vds_bootstrap/vds_bootstrap.py -+++ b/vds_bootstrap/vds_bootstrap.py -@@ -159,8 +159,7 @@ if rhel6based: - 'seabios', 'qemu-img', 'fence-agents', - 'libselinux-python', 'sanlock', 'sanlock-python') - # Gluster packages -- GLUSTER_PACK = ('vdsm-gluster', 'glusterfs-server', 'glusterfs-rdma', -- 'glusterfs-geo-replication') -+ GLUSTER_PACK = (VDSM_NAME + '-gluster', ) - else: - # Devel packages - DEVEL_PACK = ('gdb', 'tcpdump', 'strace', 'ltrace', 'sysstat', 'ntp', -diff --git a/vdsm.spec.in b/vdsm.spec.in -index 0aad124..1cb189e 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -402,7 +402,10 @@ Summary: Gluster Plugin for VDSM - BuildArch: noarch - - Requires: %{name} = %{version}-%{release} --Requires: glusterfs glusterfs-server glusterfs-fuse -+Requires: glusterfs -+Requires: glusterfs-server -+Requires: glusterfs-fuse -+Requires: glusterfs-rdma - - %description gluster - Gluster plugin enables VDSM to serve Gluster functionalities. --- -1.8.1.4 - diff --git a/0035-gluster-set-glusterfs-dependency-version.patch b/0035-gluster-set-glusterfs-dependency-version.patch deleted file mode 100644 index 97bf1a0..0000000 --- a/0035-gluster-set-glusterfs-dependency-version.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 8ad23d1cbc02d2a923fcdcf050d8a4faf26948b2 Mon Sep 17 00:00:00 2001 -From: "Bala.FA" -Date: Tue, 12 Mar 2013 14:28:08 +0530 -Subject: [PATCH 35/36] gluster: set glusterfs dependency version - -Now vdsm-gluster depends on glusterfs version 3.4.0 or higher. - -Change-Id: Icb42bf4dec26b118f52cc51701faa5e611f63c00 -Signed-off-by: Bala.FA -Reviewed-on: http://gerrit.ovirt.org/12960 -Reviewed-by: Aravinda VK -Tested-by: Aravinda VK -Reviewed-by: Dan Kenigsberg ---- - vdsm.spec.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/vdsm.spec.in b/vdsm.spec.in -index 1cb189e..60e76e5 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -402,7 +402,7 @@ Summary: Gluster Plugin for VDSM - BuildArch: noarch - - Requires: %{name} = %{version}-%{release} --Requires: glusterfs -+Requires: glusterfs >= 3.4.0 - Requires: glusterfs-server - Requires: glusterfs-fuse - Requires: glusterfs-rdma --- -1.8.1.4 - diff --git a/0036-Do-not-delete-the-template-when-zeroing-a-dependant-.patch b/0036-Do-not-delete-the-template-when-zeroing-a-dependant-.patch deleted file mode 100644 index dc34ce0..0000000 --- a/0036-Do-not-delete-the-template-when-zeroing-a-dependant-.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 37334a9b538fdb7af6e2d49eea5f7bd7bedd82b4 Mon Sep 17 00:00:00 2001 -From: Eduardo Warszawski -Date: Mon, 18 Feb 2013 18:14:31 +0200 -Subject: [PATCH 36/36] Do not delete the template when zeroing a dependant - image. - -Change-Id: I9e472334efa9dadb5389db70b0953f88b9be858a -Bug-url: https://bugzilla.redhat.com/show_bug.cgi?id=910013 -Signed-off-by: Eduardo -Reviewed-on: http://gerrit.ovirt.org/12178 -Tested-by: Haim Ateya -Reviewed-by: Dan Kenigsberg -Reviewed-by: Yeela Kaplan -Reviewed-by: Ayal Baron -Reviewed-on: http://gerrit.ovirt.org/13028 -Tested-by: Federico Simoncelli ---- - vdsm/storage/blockSD.py | 12 +++++++++--- - vdsm/storage/hsm.py | 2 +- - 2 files changed, 10 insertions(+), 4 deletions(-) - -diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py -index 862e413..e66256d 100644 ---- a/vdsm/storage/blockSD.py -+++ b/vdsm/storage/blockSD.py -@@ -945,14 +945,20 @@ class BlockStorageDomain(sd.StorageDomain): - self.log.debug("removed image dir: %s", imgPath) - return imgPath - -+ def _getImgExclusiveVols(self, imgUUID, volsImgs): -+ """Filter vols belonging to imgUUID only.""" -+ exclusives = dict((vName, v) for vName, v in volsImgs.iteritems() -+ if v.imgs[0] == imgUUID) -+ return exclusives -+ - def deleteImage(self, sdUUID, imgUUID, volsImgs): -- toDel = tuple(vName for vName, v in volsImgs.iteritems() -- if v.imgs[0] == imgUUID) -+ toDel = self._getImgExclusiveVols(imgUUID, volsImgs) - deleteVolumes(sdUUID, toDel) - self.rmDCImgDir(imgUUID, volsImgs) - - def zeroImage(self, sdUUID, imgUUID, volsImgs): -- zeroImgVolumes(sdUUID, imgUUID, volsImgs) -+ toZero = self._getImgExclusiveVols(imgUUID, volsImgs) -+ zeroImgVolumes(sdUUID, imgUUID, toZero) - self.rmDCImgDir(imgUUID, volsImgs) - - def getAllVolumes(self): -diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py -index 8bbe3b8..32a32c9 100644 ---- a/vdsm/storage/hsm.py -+++ b/vdsm/storage/hsm.py -@@ -1455,7 +1455,7 @@ class HSM: - # postZero implies block domain. Backup domains are always NFS - # hence no need to create fake template if postZero is true. - self._spmSchedule(spUUID, "zeroImage_%s" % imgUUID, dom.zeroImage, -- sdUUID, imgUUID, volsByImg.keys()) -+ sdUUID, imgUUID, volsByImg) - else: - dom.deleteImage(sdUUID, imgUUID, volsByImg) - # This is a hack to keep the interface consistent --- -1.8.1.4 - diff --git a/0037-vdsm.spec-fence-agents-all.patch b/0037-vdsm.spec-fence-agents-all.patch deleted file mode 100644 index 3229616..0000000 --- a/0037-vdsm.spec-fence-agents-all.patch +++ /dev/null @@ -1,59 +0,0 @@ -From b5cba4b364912710ab5718b2a8370305dcc90016 Mon Sep 17 00:00:00 2001 -From: Douglas Schilling Landgraf -Date: Mon, 8 Apr 2013 16:09:55 -0400 -Subject: [PATCH 37/38] vdsm.spec: fence-agents-all - -fence-agents package in version 4 replaced the package name -to fence-agents-all. This patch will adapt vdsm spec to this change. - -Change-Id: Ia7933fd043e535b568ce368e8e61f44e330b25ae -Signed-off-by: Douglas Schilling Landgraf -Reviewed-on: http://gerrit.ovirt.org/13729 -Reviewed-by: Federico Simoncelli ---- - vdsm.spec.in | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/vdsm.spec.in b/vdsm.spec.in -index 14922e0..a00e989 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -89,6 +89,7 @@ Requires: dmidecode - ExclusiveArch: x86_64 - Requires: device-mapper-multipath - Requires: e2fsprogs -+Requires: fence-agents-all - Requires: iscsi-initiator-utils - Requires: libvirt - Requires: lvm2 -@@ -106,6 +107,7 @@ Requires: libvirt >= 0.9.10-21.el6_3.5 - Requires: iscsi-initiator-utils >= 6.2.0.872-15 - Requires: device-mapper-multipath >= 0.4.9-52 - Requires: e2fsprogs >= 1.41.12-11 -+Requires: fence-agents - Requires: kernel >= 2.6.32-279.9.1 - Requires: sanlock >= 2.3-4, sanlock-python - Requires: initscripts >= 9.03.31-2.el6_3.1 -@@ -115,6 +117,11 @@ Requires: lvm2 >= 2.02.95-10.el6_3.2 - Requires: logrotate < 3.8.0 - %endif - %else -+%if 0%{?fedora} >= 19 -+Requires: fence-agents-all -+%else -+Requires: fence-agents -+%endif - # Subprocess and thread bug was found on python 2.7.2 - Requires: python >= 2.7.3 - Requires: qemu-kvm >= 2:0.15.0-4 -@@ -141,7 +148,6 @@ Requires: systemd >= 197-1.fc18.2 - - Requires: libvirt-python, libvirt-lock-sanlock, libvirt-client - Requires: psmisc >= 22.6-15 --Requires: fence-agents - Requires: bridge-utils - Requires: sos - Requires: tree --- -1.8.1.4 - diff --git a/0038-fix-storage.fuser.patch b/0038-fix-storage.fuser.patch deleted file mode 100644 index 7d2989e..0000000 --- a/0038-fix-storage.fuser.patch +++ /dev/null @@ -1,85 +0,0 @@ -From af3c0b0472f443c5c21a169b166cc1ee294d1606 Mon Sep 17 00:00:00 2001 -From: Dan Kenigsberg -Date: Sun, 24 Mar 2013 12:05:23 +0200 -Subject: [PATCH 38/39] fix storage.fuser - -Bug-Url: https://bugzilla.redhat.com/922515 -Change-Id: Iabd58847db7090f83106d30a763d09c0a7b78741 -Signed-off-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/13302 -Reviewed-by: Yaniv Bronhaim -Tested-by: Yaniv Bronhaim -Reviewed-on: http://gerrit.ovirt.org/13303 -Reviewed-by: Federico Simoncelli ---- - tests/Makefile.am | 1 + - tests/fuserTests.py | 31 +++++++++++++++++++++++++++++++ - vdsm/storage/fuser.py | 2 +- - 3 files changed, 33 insertions(+), 1 deletion(-) - create mode 100644 tests/fuserTests.py - -diff --git a/tests/Makefile.am b/tests/Makefile.am -index 8ad34e2..9aec750 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -27,6 +27,7 @@ test_modules = \ - capsTests.py \ - configNetworkTests.py \ - fileUtilTests.py \ -+ fuserTests.py \ - getAllVolumesTests.py \ - glusterTestData.py \ - gluster_cli_tests.py \ -diff --git a/tests/fuserTests.py b/tests/fuserTests.py -new file mode 100644 -index 0000000..7473dde ---- /dev/null -+++ b/tests/fuserTests.py -@@ -0,0 +1,31 @@ -+# -+# Copyright 2013 Red 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 -+# -+ -+import os -+from storage import fuser -+ -+from testrunner import VdsmTestCase -+ -+ -+class TestFuser(VdsmTestCase): -+ -+ def testSelfExe(self): -+ pid = os.getpid() -+ self.assertTrue(pid in fuser.fuser('/proc/%s/exe' % pid)) -diff --git a/vdsm/storage/fuser.py b/vdsm/storage/fuser.py -index d9becbc..135dad6 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, sudo=True) -+ (rc, out, err) = misc.execCmd(cmd, raw=True, sudo=True) - if rc != 0: - return [] - --- -1.8.1.4 - diff --git a/0039-Bump-up-libvirt-version-to-fix-network-linking.patch b/0039-Bump-up-libvirt-version-to-fix-network-linking.patch deleted file mode 100644 index 455971f..0000000 --- a/0039-Bump-up-libvirt-version-to-fix-network-linking.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 3a99d6d89d9f978052baee3c27fb58316f12b863 Mon Sep 17 00:00:00 2001 -From: "Antoni S. Puimedon" -Date: Thu, 31 Jan 2013 17:32:07 +0100 -Subject: [PATCH 39/39] Bump up libvirt version to fix network linking. - -The libvirt feature leveraged for the Network linking feature had -a bug that made it fail when the vnic had a bootorder set. See -https://bugzilla.redhat.com/906446 . This was solved and has been marked -for backport (which did not yet happen) for the version this patch -sets). - -Change-Id: Ib9e96eb0192fbea35d2723cafbec145b629371fa -Signed-off-by: Antoni S. Puimedon -Reviewed-on: http://gerrit.ovirt.org/11600 -Reviewed-by: Dan Kenigsberg -Tested-by: Dan Kenigsberg ---- - vdsm.spec.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/vdsm.spec.in b/vdsm.spec.in -index 60e76e5..14922e0 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -119,7 +119,7 @@ Requires: logrotate < 3.8.0 - Requires: python >= 2.7.3 - Requires: qemu-kvm >= 2:0.15.0-4 - Requires: qemu-img >= 2:0.15.0-4 --Requires: libvirt >= 0.10.1-1 -+Requires: libvirt >= 0.10.2.4-1 - Requires: iscsi-initiator-utils >= 6.2.0.872-14 - Requires: device-mapper-multipath >= 0.4.9-18 - Requires: e2fsprogs >= 1.41.14 --- -1.8.1.4 - diff --git a/0040-vdsm.spec.in-with_gluster.patch b/0040-vdsm.spec.in-with_gluster.patch deleted file mode 100644 index 6e19f2a..0000000 --- a/0040-vdsm.spec.in-with_gluster.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 529d7816dc1b5959a446ebef393dca154d6e4364 Mon Sep 17 00:00:00 2001 -From: Douglas Schilling Landgraf -Date: Mon, 8 Apr 2013 18:17:13 -0400 -Subject: [PATCH] vdsm.spec.in: with_gluster - -Option to manage Gluster sub-package. - -Change-Id: I925c1b12f0447798eaae6da72d726bc007511e1c -Signed-off-by: Douglas Schilling Landgraf -Reviewed-on: http://gerrit.ovirt.org/13731 -Reviewed-by: Federico Simoncelli ---- - vdsm.spec.in | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/vdsm.spec.in b/vdsm.spec.in -index a00e989..4bc4c6e 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -3,6 +3,9 @@ - %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@ -@@ -403,6 +406,7 @@ BuildArch: noarch - %description hook-vmdisk - Hook adds additional disk image for a VM (raw or qcow2) - -+%if 0%{?with_gluster} - %package gluster - Summary: Gluster Plugin for VDSM - BuildArch: noarch -@@ -415,6 +419,7 @@ Requires: glusterfs-rdma - - %description gluster - Gluster plugin enables VDSM to serve Gluster functionalities. -+%endif - - %prep - %setup -q -@@ -820,8 +825,12 @@ exit 0 - %{_datadir}/%{vdsm_name}/tests/run_tests.sh - %{_datadir}/%{vdsm_name}/tests/route_info.out - %{_datadir}/%{vdsm_name}/tests/tc_filter_show.out -+%if 0%{?with_gluster} - %{_datadir}/%{vdsm_name}/tests/glusterVolumeProfileInfo.xml - %{_datadir}/%{vdsm_name}/tests/glusterVolumeProfileInfoNfs.xml -+%else -+%exclude %{_datadir}/%{vdsm_name}/tests/gluster* -+%endif - %{_datadir}/%{vdsm_name}/tests/functional/*.py* - - %files hook-vhostmd -@@ -994,6 +1003,7 @@ exit 0 - %{_libexecdir}/%{vdsm_name}/hooks/after_vdsm_stop/10_faqemu - %{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/10_faqemu - -+%if 0%{?with_gluster} - %files gluster - %defattr(-, root, root, -) - %dir %{_datadir}/%{vdsm_name}/gluster -@@ -1003,6 +1013,10 @@ exit 0 - %{_datadir}/%{vdsm_name}/gluster/cli.py* - %{_datadir}/%{vdsm_name}/gluster/exception.py* - %{_datadir}/%{vdsm_name}/gluster/hostname.py* -+%else -+%exclude %{_datadir}/%{vdsm_name}/gluster/* -+%endif -+ - - %changelog - * Wed Oct 12 2011 Federico Simoncelli - 4.9.0-0 --- -1.8.1.4 - diff --git a/0041-Don-t-user-sudo-in-fuser.patch b/0041-Don-t-user-sudo-in-fuser.patch deleted file mode 100644 index 7dc6d32..0000000 --- a/0041-Don-t-user-sudo-in-fuser.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 1576791841cdb21c95bea65f214c333cb4c188ac Mon Sep 17 00:00:00 2001 -From: Saggi Mizrahi -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 -Reviewed-on: http://gerrit.ovirt.org/13779 -Reviewed-by: Dan Kenigsberg -Tested-by: Antoni Segura Puimedon -Reviewed-on: http://gerrit.ovirt.org/13810 -Reviewed-by: Federico Simoncelli -Tested-by: Federico Simoncelli ---- - 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 deleted file mode 100644 index 06dd3c4..0000000 --- a/0042-svdsm-fix-fuser-import-in-supervdsmServer.patch +++ /dev/null @@ -1,31 +0,0 @@ -From acd99086f6f7d0b2f94065806be6faaee0f41f46 Mon Sep 17 00:00:00 2001 -From: Federico Simoncelli -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 -Reviewed-on: http://gerrit.ovirt.org/13804 -Reviewed-by: Yaniv Bronhaim -Reviewed-by: Dan Kenigsberg -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 deleted file mode 100644 index 0536202..0000000 --- a/0043-Removing-vdsm-configuration-when-removing-vdsm-servi.patch +++ /dev/null @@ -1,62 +0,0 @@ -From b7743c5593b72d1e669a8ace7a5a657fb9eb8643 Mon Sep 17 00:00:00 2001 -From: Yaniv Bronhaim -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 -Reviewed-on: http://gerrit.ovirt.org/11295 -Reviewed-by: Dan Kenigsberg -Reviewed-by: Douglas Schilling Landgraf -Reviewed-on: http://gerrit.ovirt.org/13812 -Reviewed-by: Federico Simoncelli -Tested-by: Federico Simoncelli ---- - 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 deleted file mode 100644 index 6dd59f7..0000000 --- a/0044-Seperating-supervdsm-log-to-supervdsm.log-file.patch +++ /dev/null @@ -1,144 +0,0 @@ -From baf505e8698f38fdeeb152ffe1d4377f94a39231 Mon Sep 17 00:00:00 2001 -From: Yaniv Bronhaim -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 -Reviewed-on: https://gerrit.eng.lab.tlv.redhat.com/7190 -Reviewed-by: Dan Kenigsberg -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 deleted file mode 100644 index 059adcc..0000000 --- a/0045-vdsm.spec-Adding-with_systemd-macro.patch +++ /dev/null @@ -1,124 +0,0 @@ -From 20becc2c3174ab500f4bce4f75a9604de30c9c35 Mon Sep 17 00:00:00 2001 -From: Douglas Schilling Landgraf -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 -Reviewed-on: http://gerrit.ovirt.org/12086 -Tested-by: oVirt Jenkins CI Server -Reviewed-by: Vinzenz Feenstra -Reviewed-by: Yaniv Bronhaim -Reviewed-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/13814 -Reviewed-by: Federico Simoncelli ---- - 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 deleted file mode 100644 index b130923..0000000 --- a/0046-spec-use-the-fedora-systemd-macros.patch +++ /dev/null @@ -1,140 +0,0 @@ -From d848def9d4e011c234675130c9588c86e6f6a411 Mon Sep 17 00:00:00 2001 -From: Federico Simoncelli -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 -Reviewed-on: http://gerrit.ovirt.org/12285 -Reviewed-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/13815 -Tested-by: Douglas Schilling Landgraf -Reviewed-by: Yaniv Bronhaim ---- - 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 deleted file mode 100644 index 258f1f5..0000000 --- a/0047-spec-enable-gluster-upstream-and-on-fedora-19.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 7fd5b70e91f59d396da79b44ae1dc6edba2c7d49 Mon Sep 17 00:00:00 2001 -From: Federico Simoncelli -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 -Reviewed-on: http://gerrit.ovirt.org/13791 -Reviewed-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/13816 -Reviewed-by: Yaniv Bronhaim -Tested-by: Douglas Schilling Landgraf ---- - 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/0048-Makefile.am-ignore-false-positive-pyflakes-lvm.py.patch b/0048-Makefile.am-ignore-false-positive-pyflakes-lvm.py.patch deleted file mode 100644 index 41735b7..0000000 --- a/0048-Makefile.am-ignore-false-positive-pyflakes-lvm.py.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 96c4ae5b46a83cd7099fd2a0558e2be7e8831d3a Mon Sep 17 00:00:00 2001 -From: Douglas Schilling Landgraf -Date: Tue, 23 Apr 2013 15:24:13 -0400 -Subject: [PATCH] Makefile.am: ignore false positive pyflakes lvm.py - -Temporary workaround. - -Change-Id: Id8cdeb0c28c1ee5dc3a18a7688ae60fe641f9a6c -Signed-off-by: Douglas Schilling Landgraf -Reviewed-on: http://gerrit.ovirt.org/14184 -Reviewed-by: Dan Kenigsberg ---- - Makefile.am | 7 ++++++- - 1 files changed, 6 insertions(+), 1 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 06ffbf9..7b0d161 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -99,9 +99,14 @@ PEP8_WHITELIST = \ - - PEP8_BLACKLIST = apiData.py,config.py,constants.py - -+SKIP_PYFLAKES_ERR = "\./vdsm/storage/lvm\.py.*: list comprehension redefines \ -+ 'lv' from line .*" -+ - check-local: - find . -path './.git' -prune -type f -o \ -- -name '*.py' -o -name '*.py.in' | xargs $(PYFLAKES) -+ -name '*.py' -o -name '*.py.in' | xargs $(PYFLAKES) | \ -+ grep -w -v $(SKIP_PYFLAKES_ERR) | \ -+ while read LINE; do echo "$$LINE"; false; done - $(PEP8) --exclude="$(PEP8_BLACKLIST)" --filename '*.py,*.py.in' \ - --ignore=E126,E127,E128 \ - $(PEP8_WHITELIST) --- -1.7.1 - diff --git a/0049-Deactivate-libvirtVM.Drives.patch b/0049-Deactivate-libvirtVM.Drives.patch deleted file mode 100644 index 24aa19b..0000000 --- a/0049-Deactivate-libvirtVM.Drives.patch +++ /dev/null @@ -1,79 +0,0 @@ -From b94d0a6c37303a977a46fe95ee77a2dd287d862c Mon Sep 17 00:00:00 2001 -From: Eduardo Warszawski -Date: Sun, 19 May 2013 20:20:07 +0300 -Subject: [PATCH] Deactivate libvirtVM.Drives() - -Change I8d310f216987b7 has introduced teardownVolumePath() calls with a -Drive object instead of a drive dictionary from self.conf. -In its previous form, teardownVolumePath() has silently ignored such -input, keeping the volume active. - -This patch makes teardownVolumePath() handle such inputs properly. This -is one baby step in the process of getting rid of self.conf: we would -like to use the objects everywhere within vdsm. - -Note that this patch introduces an ugly log line when pointlessly trying -to tear down a cdrom device. This would be fixed in a subsequent patch. - -Change-Id: I8ba965f0987037fa5dafc6b3ea6eeb6f01a82436 -Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=962549 -Signed-off-by: Eduardo -Signed-off-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/14869 -Reviewed-on: http://gerrit.ovirt.org/14953 -Tested-by: Federico Simoncelli ---- - vdsm/clientIF.py | 17 ++++++++++------- - vdsm/libvirtvm.py | 8 ++++++++ - 2 files changed, 18 insertions(+), 7 deletions(-) - -diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py -index 65b4e72..fabd494 100644 ---- a/vdsm/clientIF.py -+++ b/vdsm/clientIF.py -@@ -318,13 +318,16 @@ class clientIF: - - def teardownVolumePath(self, drive): - res = {'status': doneCode} -- if type(drive) == dict: -- try: -- res = self.irs.teardownImage(drive['domainID'], -- drive['poolID'], drive['imageID']) -- except KeyError: -- #This drive is not a vdsm image (quartet) -- self.log.info("Avoiding tear down drive %s", str(drive)) -+ try: -+ res = self.irs.teardownImage(drive['domainID'], -+ drive['poolID'], drive['imageID']) -+ except KeyError: -+ self.log.warning("Drive is not a vdsm image: %s", -+ drive, exc_info=True) -+ except TypeError: -+ if not isinstance(drive, basestring): -+ raise -+ # paths (strings) are not deactivated - - return res['status']['code'] - -diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py -index 19c5547..91f7a56 100644 ---- a/vdsm/libvirtvm.py -+++ b/vdsm/libvirtvm.py -@@ -1071,6 +1071,14 @@ class Drive(LibvirtVmDevice): - - self._customize() - -+ def __getitem__(self, key): -+ try: -+ value = getattr(self, str(key)) -+ except AttributeError: -+ raise KeyError(key) -+ else: -+ return value -+ - @property - def volExtensionChunk(self): - """ --- -1.7.1 - diff --git a/0050-vdsm-fix-Vm-cleanup-routine.patch b/0050-vdsm-fix-Vm-cleanup-routine.patch deleted file mode 100644 index a13a6a6..0000000 --- a/0050-vdsm-fix-Vm-cleanup-routine.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 0939dd0d8c23067f6c74d722a07c46623f57a6da Mon Sep 17 00:00:00 2001 -From: Peter V. Saveliev -Date: Thu, 4 Apr 2013 15:28:29 +0200 -Subject: [PATCH] vdsm: fix Vm cleanup routine - -The issue was that on Vm disk hot unplug the general clean up routine -was called, that wiped out also qemu and ovirt guest agent's sockets. - -Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=927143 -Signed-off-by: Peter V. Saveliev -Change-Id: Ie355022866d008a83257b1b6e3a4226a07d34c2f -Reviewed-on: http://gerrit.ovirt.org/13610 -Reviewed-by: Dan Kenigsberg -Reviewed-by: Vered Volansky -Reviewed-on: http://gerrit.ovirt.org/15055 -Tested-by: Federico Simoncelli ---- - vdsm/libvirtvm.py | 10 ++++++++-- - vdsm/vm.py | 23 ++++++++++++++++++++--- - 2 files changed, 28 insertions(+), 5 deletions(-) - -diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py -index fe140ec..19c5547 100644 ---- a/vdsm/libvirtvm.py -+++ b/vdsm/libvirtvm.py -@@ -1391,7 +1391,13 @@ class LibvirtVm(vm.Vm): - self._guestEventTime = self._startTime - - def _cleanup(self): -- vm.Vm._cleanup(self) -+ """ -+ General clean up routine -+ """ -+ self._cleanupDrives() -+ self._cleanupFloppy() -+ self._cleanupGuestAgent() -+ utils.rmFile(self._recoveryFile) - utils.rmFile(self._qemuguestSocketFile) - - def updateGuestCpuRunning(self): -@@ -1874,7 +1880,7 @@ class LibvirtVm(vm.Vm): - 'status': {'code': errCode['hotunplugDisk']['status']['code'], - 'message': e.message}} - else: -- self._cleanup() -+ self._cleanupDrives(drive) - - return {'status': doneCode, 'vmList': self.status()} - -diff --git a/vdsm/vm.py b/vdsm/vm.py -index 9610644..c0d98ad 100644 ---- a/vdsm/vm.py -+++ b/vdsm/vm.py -@@ -1030,15 +1030,29 @@ class Vm(object): - except: - self.log.error("_timedShutdown failed", exc_info=True) - -- def _cleanup(self): -+ def _cleanupDrives(self, *drives): -+ """ -+ Clean up drives related stuff. Sample usage: -+ -+ self._cleanupDrives() -+ self._cleanupDrives(drive) -+ self._cleanupDrives(drive1, drive2, drive3) -+ self._cleanupDrives(*drives_list) -+ """ -+ drives = drives or self._devices[DISK_DEVICES] -+ # clean them up - with self._volPrepareLock: -- for drive in self._devices[DISK_DEVICES]: -+ for drive in drives: - try: - self.cif.teardownVolumePath(drive) - except: - self.log.error("Drive teardown failure for %s", - drive, exc_info=True) - -+ def _cleanupFloppy(self): -+ """ -+ Clean up floppy drive -+ """ - if self.conf.get('volatileFloppy'): - try: - self.log.debug("Floppy %s cleanup" % self.conf['floppy']) -@@ -1046,13 +1060,16 @@ class Vm(object): - except: - pass - -+ def _cleanupGuestAgent(self): -+ """ -+ Try to stop the guest agent and clean up its socket -+ """ - try: - self.guestAgent.stop() - except: - pass - - utils.rmFile(self._guestSocketFile) -- utils.rmFile(self._recoveryFile) - - def setDownStatus(self, code, reason): - try: --- -1.7.1 - diff --git a/0051-Support-teardownVolumePath-None.patch b/0051-Support-teardownVolumePath-None.patch deleted file mode 100644 index 421d1a5..0000000 --- a/0051-Support-teardownVolumePath-None.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 617ff7d9e577c0c09bbe277543a0cf28120b6f4f Mon Sep 17 00:00:00 2001 -From: Eduardo Warszawski -Date: Wed, 22 May 2013 12:40:54 +0300 -Subject: [PATCH] Support teardownVolumePath(None) - -Change-Id: I68bc4996ec1789e090111e8aeadaf733e163543b -Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=962549 -Signed-off-by: Eduardo -Reviewed-on: http://gerrit.ovirt.org/15316 -Reviewed-by: Federico Simoncelli -Reviewed-by: Douglas Schilling Landgraf -Reviewed-by: Vinzenz Feenstra -Reviewed-by: Dan Kenigsberg -Tested-by: Dan Kenigsberg -Reviewed-on: http://gerrit.ovirt.org/15353 -Tested-by: Federico Simoncelli ---- - vdsm/clientIF.py | 10 ++++------ - 1 files changed, 4 insertions(+), 6 deletions(-) - -diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py -index fabd494..fec7d39 100644 ---- a/vdsm/clientIF.py -+++ b/vdsm/clientIF.py -@@ -321,13 +321,11 @@ class clientIF: - try: - res = self.irs.teardownImage(drive['domainID'], - drive['poolID'], drive['imageID']) -- except KeyError: -- self.log.warning("Drive is not a vdsm image: %s", -- drive, exc_info=True) -- except TypeError: -- if not isinstance(drive, basestring): -- raise -+ except (KeyError, TypeError): - # paths (strings) are not deactivated -+ if not isinstance(drive, basestring): -+ self.log.warning("Drive is not a vdsm image: %s", -+ drive, exc_info=True) - - return res['status']['code'] - --- -1.7.1 - diff --git a/0052-vdsm.spec-update-python-pthreading.patch b/0052-vdsm.spec-update-python-pthreading.patch deleted file mode 100644 index 9c6d373..0000000 --- a/0052-vdsm.spec-update-python-pthreading.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 3f66bb373d43072de4a3e39019e0d7df9791f274 Mon Sep 17 00:00:00 2001 -From: Douglas Schilling Landgraf -Date: Fri, 14 Jun 2013 02:47:26 -0400 -Subject: [PATCH] vdsm.spec: update python-pthreading - -F19 and EL7 should require python-pthreading >= 1.0.2 - -Change-Id: Ie50a5b7a794b9df135478f3adace7501893d992c -Signed-off-by: Douglas Schilling Landgraf -Reviewed-on: http://gerrit.ovirt.org/15705 -Reviewed-by: Dan Kenigsberg ---- - vdsm.spec.in | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/vdsm.spec.in b/vdsm.spec.in -index 9a44260..8c00001 100644 ---- a/vdsm.spec.in -+++ b/vdsm.spec.in -@@ -93,7 +93,6 @@ Requires: iproute - Requires: python-ethtool - Requires: rpm-python - Requires: nfs-utils --Requires: python-pthreading - Requires: m2crypto - Requires: %{name}-xmlrpc = %{version}-%{release} - -@@ -112,6 +111,7 @@ Requires: iscsi-initiator-utils - Requires: libvirt - Requires: lvm2 - Requires: python -+Requires: python-pthreading >= 0.1.2 - Requires: qemu-kvm - Requires: qemu-kvm-img - Requires: sanlock, sanlock-python -@@ -130,14 +130,17 @@ Requires: kernel >= 2.6.32-279.9.1 - Requires: sanlock >= 2.3-4, sanlock-python - Requires: initscripts >= 9.03.31-2.el6_3.1 - Requires: mom >= 0.3.0 -+Requires: python-pthreading - Requires: selinux-policy-targeted >= 3.7.19-80 - Requires: lvm2 >= 2.02.95-10.el6_3.2 - Requires: logrotate < 3.8.0 - %endif - %else - %if 0%{?fedora} >= 19 -+Requires: python-pthreading >= 0.1.2 - Requires: fence-agents-all - %else -+Requires: python-pthreading - Requires: fence-agents - %endif - # Subprocess and thread bug was found on python 2.7.2 --- -1.8.2.1 - diff --git a/0053-service-make-iscsid-a-systemd-dependency.patch b/0053-service-make-iscsid-a-systemd-dependency.patch deleted file mode 100644 index 2349dc8..0000000 --- a/0053-service-make-iscsid-a-systemd-dependency.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 73463217963c3c138fdac822a092fc68b8541b8a Mon Sep 17 00:00:00 2001 -From: Douglas Schilling Landgraf -Date: Mon, 8 Jul 2013 20:50:50 -0400 -Subject: [PATCH] service: make iscsid a systemd dependency - -Also remove starting iscsid with force-start as it is no longer -supported - -master commit 3c0adf791e790c820d44317204f275aa09513318 - -Change-Id: I461cf35763c495b0630acf9d4a7c8716036ad41e -Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=981906 -Signed-off-by: Douglas Schilling Landgraf -Reviewed-on: http://gerrit.ovirt.org/16527 -Reviewed-by: Federico Simoncelli ---- - vdsm/vdsmd.init.in | 1 - - vdsm/vdsmd.service | 2 +- - 2 files changed, 1 insertion(+), 2 deletions(-) - -diff --git a/vdsm/vdsmd.init.in b/vdsm/vdsmd.init.in -index c8223d3..9789437 100755 ---- a/vdsm/vdsmd.init.in -+++ b/vdsm/vdsmd.init.in -@@ -158,7 +158,6 @@ start_needed_srv() { - fi - done - -- /sbin/service iscsid force-start - } - - test_lo() { -diff --git a/vdsm/vdsmd.service b/vdsm/vdsmd.service -index 9823b34..9ed69ba 100644 ---- a/vdsm/vdsmd.service -+++ b/vdsm/vdsmd.service -@@ -1,6 +1,6 @@ - [Unit] - Description=Virtual Desktop Server Manager --Requires=multipathd.service libvirtd.service time-sync.target -+Requires=multipathd.service libvirtd.service time-sync.target iscsid.service - Conflicts=libvirt-guests.service - - [Service] --- -1.8.2.1 - diff --git a/sources b/sources index d373508..3cc5616 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -6e181a25b2b4fc9e5f85faafc9d73aa1 vdsm-4.10.3.tar.gz +1872fb0d60a1a4908349ef958e19f611 vdsm-4.12.0.tar.gz diff --git a/vdsm.spec b/vdsm.spec index 0acce9f..db5d2fa 100644 --- a/vdsm.spec +++ b/vdsm.spec @@ -31,7 +31,7 @@ %global _polkitdir %{_localstatedir}/lib/polkit-1/localauthority/10-vendor.d %endif -%if !0%{fedora_koji_build} || 0%{?fedora} >= 19 +%if 0%{?fedora} >= 17 || 0%{?rhel} >= 6 %global with_gluster 1 %endif @@ -41,11 +41,12 @@ %if 0%{?fedora} >= 18 %global with_systemd_macros 1 +%global with_tmpfiles_macro 1 %endif Name: %{vdsm_name} -Version: 4.10.3 -Release: 18%{?vdsm_relvtag}%{?dist}%{?extra_release} +Version: 4.12.0 +Release: 0.1.rc3%{?vdsm_relvtag}%{?dist}%{?extra_release} Summary: Virtual Desktop Server Manager Group: Applications/System @@ -59,69 +60,14 @@ 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.2 patches -Patch0: 0001-schema-Fix-schema-for-VM.updateDevice.patch -Patch1: 0002-schema-Missing-comment-for-new-VmDeviceType.patch -Patch2: 0003-api-Report-CPU-thread-info-in-getVdsCapabilities.patch -Patch3: 0004-caps.py-osversion-validate-OVIRT.patch -Patch4: 0005-restarting-libvirtd-didn-t-work-over-allinone-setup.patch -Patch5: 0006-Integrate-Smartcard-support.patch -Patch6: 0007-vdsm.spec-python-ordereddict-only-for-rhel-7.patch -Patch7: 0008-vdsm.spec-Don-t-require-python-ordereddict-on-fedora.patch -Patch8: 0009-vdsm.spec-BuildRequires-python-pthreading.patch -Patch9: 0010-Searching-for-both-py-and-pyc-file-to-start-super-vd.patch -Patch10: 0011-adding-getHardwareInfo-API-to-vdsm.patch -Patch11: 0012-Explicitly-shutdown-m2crypto-socket.patch -Patch12: 0013-spec-require-policycoreutils-and-skip-sebool-errors.patch -Patch13: 0014-spec-requires-selinux-policy-to-avoid-selinux-failur.patch -Patch14: 0015-vdsmd.service-require-either-ntpd-or-chronyd.patch -Patch15: 0016-isRunning-didn-t-check-local-variable-before-reading.patch -Patch16: 0017-udev-Race-fix-load-and-trigger-dev-rule.patch -Patch17: 0018-Change-scsi_id-command-path-to-be-configured-at-runt.patch -Patch18: 0019-upgrade-force-upgrade-to-v2-before-upgrading-to-v3.patch -Patch19: 0020-misc-rename-safelease-to-clusterlock.patch -Patch20: 0021-domain-select-the-cluster-lock-using-makeClusterLock.patch -Patch21: 0022-clusterlock-add-the-local-locking-implementation.patch -Patch22: 0023-upgrade-catch-MetaDataKeyNotFoundError-when-preparin.patch -Patch23: 0024-vdsm.spec-Require-openssl.patch -Patch24: 0025-Fedora-18-require-a-newer-udev.patch -Patch25: 0026-fix-sloppy-backport-of-safelease-rename.patch -Patch26: 0027-removing-the-use-of-zombie-reaper-from-supervdsm.patch -Patch27: 0028-configNet-allow-delete-update-of-devices-with-no-ifc.patch -Patch28: 0029-Requires-policycoreutils-2.1.13-55-to-avoid-another-.patch -Patch29: 0030-After-fail-to-connect-to-supervdsm-more-than-3-time-.patch -# This patch is not present in the upstream ovirt-3.2 branch and it was added to -# add a missing file in the base vdsm tar.gz -Patch30: 0031-packaging-add-load_needed_modules.py.in.patch -Patch31: 0032-tool-_enable_bond_dev-reopen-bonding_masters-per-bon.patch -Patch32: 0033-gluster-Handling-Attribute-error-in-Python-2.6.patch -Patch33: 0034-bootstrap-remove-glusterfs-packages.patch -Patch34: 0035-gluster-set-glusterfs-dependency-version.patch -Patch35: 0036-Do-not-delete-the-template-when-zeroing-a-dependant-.patch -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 -Patch47: 0048-Makefile.am-ignore-false-positive-pyflakes-lvm.py.patch -Patch48: 0049-Deactivate-libvirtVM.Drives.patch -Patch49: 0050-vdsm-fix-Vm-cleanup-routine.patch -Patch50: 0051-Support-teardownVolumePath-None.patch -Patch51: 0052-vdsm.spec-update-python-pthreading.patch -Patch52: 0053-service-make-iscsid-a-systemd-dependency.patch +Patch0: 0001-build-use-pythondir-for-vdsmapi.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python BuildRequires: python-devel BuildRequires: python-nose +BuildRequires: python-netaddr # BuildRequires needed by the tests during the build BuildRequires: python-ethtool @@ -137,6 +83,7 @@ BuildRequires: python-dmidecode %if 0%{?rhel} == 6 BuildRequires: python-ordereddict %endif +BuildRequires: python-ethtool # Autotools BuildRequires %if 0%{?enable_autotools} @@ -158,30 +105,51 @@ BuildRequires: systemd-units Requires: which Requires: sudo >= 1.7.3 Requires: logrotate +Requires: rsyslog Requires: xz Requires: ntp Requires: iproute -Requires: python-ethtool +Requires: python-netaddr +Requires: python-inotify +Requires: python-ethtool >= 0.6-3 Requires: rpm-python Requires: nfs-utils Requires: m2crypto +Requires: libguestfs-tools-c Requires: %{name}-xmlrpc = %{version}-%{release} +Requires: mom >= 0.3.2 %ifarch x86_64 Requires: python-dmidecode Requires: dmidecode %endif +%if 0%{?rhel} >= 7 || 0%{?fedora} >= 18 +Requires: libvirt-daemon >= 1.0.2-1 +Requires: libvirt-daemon-config-nwfilter +Requires: libvirt-daemon-driver-network +Requires: libvirt-daemon-driver-nwfilter +Requires: libvirt-daemon-driver-qemu +%else %if 0%{?rhel} +Requires: libvirt >= 0.10.2-18.el6_4.4 +%else +Requires: libvirt >= 1.0.2-1 +%endif +%endif +Requires: libvirt-python, libvirt-lock-sanlock, libvirt-client + +%if 0%{?rhel} +Requires: python-ethtool >= 0.6-3 %if 0%{?rhel} >= 7 ExclusiveArch: x86_64 Requires: device-mapper-multipath Requires: e2fsprogs Requires: fence-agents-all Requires: iscsi-initiator-utils -Requires: libvirt Requires: lvm2 Requires: python +Requires: policycoreutils-python Requires: python-pthreading >= 0.1.2 Requires: qemu-kvm Requires: qemu-kvm-img @@ -192,7 +160,6 @@ Requires: python # Update the qemu-kvm requires when block_stream will be included Requires: qemu-kvm >= 2:0.12.1.2-2.295.el6_3.4 Requires: qemu-img >= 2:0.12.1.2-2.295.el6_3.4 -Requires: libvirt >= 0.9.10-21.el6_3.5 Requires: iscsi-initiator-utils >= 6.2.0.872-15 Requires: device-mapper-multipath >= 0.4.9-52 Requires: e2fsprogs >= 1.41.12-11 @@ -200,9 +167,10 @@ Requires: fence-agents Requires: kernel >= 2.6.32-279.9.1 Requires: sanlock >= 2.3-4, sanlock-python Requires: initscripts >= 9.03.31-2.el6_3.1 -Requires: mom >= 0.3.0 +Requires: policycoreutils >= 2.0.83-19.30 +Requires: policycoreutils-python >= 2.0.83-19.30 Requires: python-pthreading -Requires: selinux-policy-targeted >= 3.7.19-80 +Requires: selinux-policy-targeted >= 3.7.19-155 Requires: lvm2 >= 2.02.95-10.el6_3.2 Requires: logrotate < 3.8.0 %endif @@ -218,13 +186,16 @@ Requires: fence-agents Requires: python >= 2.7.3 Requires: qemu-kvm >= 2:0.15.0-4 Requires: qemu-img >= 2:0.15.0-4 -Requires: libvirt >= 0.10.2.4-1 +Requires: python-ethtool >= 0.8-1 +%if 0%{?fedora} >= 18 +Requires: initscripts >= 9.42.2-1 +%endif Requires: iscsi-initiator-utils >= 6.2.0.872-14 Requires: device-mapper-multipath >= 0.4.9-18 Requires: e2fsprogs >= 1.41.14 Requires: kernel >= 3.6 -Requires: mom >= 0.3.0 Requires: sanlock >= 2.4-2, sanlock-python +Requires: policycoreutils-python Requires: sed >= 4.2.1-10 Requires: selinux-policy-targeted >= 3.10.0-149 Requires: lvm2 >= 2.02.95 @@ -238,13 +209,11 @@ Requires: policycoreutils >= 2.1.13-55 Requires: systemd >= 197-1.fc18.2 %endif -Requires: libvirt-python, libvirt-lock-sanlock, libvirt-client Requires: psmisc >= 22.6-15 Requires: bridge-utils Requires: sos Requires: tree Requires: dosfstools -Requires: policycoreutils-python Requires: genisoimage Requires: libselinux-python Requires: %{name}-python = %{version}-%{release} @@ -267,6 +236,7 @@ BuildArch: noarch Requires: %{name}-python = %{version}-%{release} Requires: %{name}-xmlrpc = %{version}-%{release} +Requires: %{name}-python-cpopen %description cli Call VDSM commands from the command line. Used for testing and debugging. @@ -276,16 +246,26 @@ Summary: VDSM xmlrpc API BuildArch: noarch Requires: %{name}-python = %{version}-%{release} +Requires: %{name}-python-cpopen + %description xmlrpc An XMLRPC interface for interacting with vdsmd. Primary control interface for ovirt-engine and vdsClient. +%package api +Summary: VDSM API definition +BuildArch: noarch + +%description api +Provides the VDSM API schema and documentation. + %package jsonrpc Summary: VDSM API Server BuildArch: noarch Requires: %{name}-python = %{version}-%{release} +Requires: %{name}-api = %{version}-%{release} %if 0%{?rhel} == 6 Requires: python-ordereddict %endif @@ -293,6 +273,15 @@ Requires: python-ordereddict %description jsonrpc A Json-based RPC interface that serves as the protocol for libvdsm. +%package yajsonrpc +Summary: JSON RPC server and client implementation +BuildArch: noarch + +Requires: python >= 2.6 + +%description yajsonrpc +A JSON RPC server and client implementation. + %package bootstrap Summary: VDSM bootstrapping package BuildArch: noarch @@ -313,6 +302,15 @@ Requires: openssl VDSM registration package. Used to register a Linux host to a Virtualization Manager. +%package python-cpopen +Summary: Creates a sub-process in simpler safer manner. + +BuildRequires: python2-devel + +%description python-cpopen +Python package for creating sub-process in simpler and safer manner by using C +code. + %package python Summary: VDSM python libraries @@ -338,6 +336,15 @@ BuildArch: noarch %description tests A test suite for verifying the functionality of a running vdsm instance +%package hook-checkimages +Summary: Qcow2 disk image format check hook for VDSM +BuildArch: noarch +Requires: vdsm + +%description hook-checkimages +VDSM hook used to perform consistency check on a qcow2 format disk image +using the QEMU disk image utility. + %package hook-vhostmd Summary: VDSM hook set for interaction with vhostmd Requires: vhostmd @@ -365,6 +372,13 @@ BuildArch: noarch VDSM hook enable user to add storage LUN for VDSM without the sharing and storage handling of VDSM. +%package hook-macspoof +Summary: Disables MAC spoofing filtering +BuildArch: noarch + +%description hook-macspoof +VDSM hook that disables mac spoof filtering on all the of the VM's interfaces. + %package hook-fileinject Summary: Allow uploading file to VMs disk BuildArch: noarch @@ -384,6 +398,7 @@ Allow adding floppy to VM %package hook-hostusb Summary: Allow attaching USB device from host BuildArch: noarch +Requires: usbutils %description hook-hostusb Hook is getting vendor and product id of USB device @@ -416,13 +431,20 @@ If the nested virtualization is enabled in your kvm module this hook will expose it to the guests. %package hook-numa -Summary: numa sopport for VDSM +Summary: NUMA support for VDSM BuildArch: noarch %description hook-numa -Hooks is getting number/rage of numa nodes and numa mode, +Hooks is getting number/rage of NUMA nodes and NUMA mode, and update the VM xml. +%package hook-openstacknet +Summary: OpenStack Network vNICs support for VDSM +BuildArch: noarch + +%description hook-openstacknet +Hook for OpenStack Network vNICs. + %package hook-pincpu Summary: Hook pin VM so specific CPUs BuildArch: noarch @@ -476,6 +498,7 @@ such as: vendor, version, date and release %package hook-sriov Summary: sr-iov support for VDSM +Requires: libvirt-daemon-driver-nodedev BuildArch: noarch %description hook-sriov @@ -506,6 +529,7 @@ Requires: glusterfs >= 3.4.0 Requires: glusterfs-server Requires: glusterfs-fuse Requires: glusterfs-rdma +Requires: python-magic %description gluster Gluster plugin enables VDSM to serve Gluster functionalities. @@ -513,62 +537,7 @@ Gluster plugin enables VDSM to serve Gluster functionalities. %prep %setup -q - -# ovirt-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 -%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 -%patch47 -p1 -%patch48 -p1 -%patch49 -p1 -%patch50 -p1 -%patch51 -p1 -%patch52 -p1 - %if 0%{?rhel} == 6 sed -i '/ su /d' vdsm/vdsm-logrotate.conf.in %endif @@ -582,7 +551,9 @@ make # Setting software_version and software_revision in dsaversion.py baserelease=`echo "%{release}" | sed 's/\([0-9]\+\(\.[0-9]\+\)\?\).*/\1/'` baseversion=`echo "%{version}" | sed 's/\([0-9]\+\(\.[0-9]\+\)\?\).*/\1/'` +rawversion=%{version}-%{release} sed -i -e 's/^software_version =.*/software_version = "'"${baseversion}"'"/' \ + -e 's/^raw_version_revision =.*/raw_version_revision = "'"${rawversion}"'"/' \ -e 's/^software_revision =.*/software_revision = "'"${baserelease}"'"/' vdsm/dsaversion.py %install @@ -604,14 +575,29 @@ install -Dm 0644 vdsm/limits.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 0644 vdsm/supervdsmd.service %{buildroot}%{_unitdir}/supervdsmd.service + +install -Dm 0644 vdsm/vdsm-restore-net-config.service \ + %{buildroot}%{_unitdir}/vdsm-restore-net-config.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 -Dm 0644 vdsm/vdsm-modules-load.d.conf \ + %{buildroot}%{_sysconfdir}/modules-load.d/vdsm.conf %else # Install the SysV init scripts install -Dm 0755 vdsm/vdsmd.init %{buildroot}%{_initrddir}/vdsmd +install -Dm 0755 vdsm/supervdsmd.init %{buildroot}%{_initrddir}/supervdsmd + install -Dm 0755 vdsm_reg/vdsm-reg.init %{buildroot}%{_initrddir}/vdsm-reg +install -Dm 0755 vdsm/vdsm-restore-net-config.init \ + %{buildroot}%{_initrddir}/vdsm-restore-net-config +%endif + +%if 0%{?with_tmpfiles_macro} +install -Dm 0644 vdsm/vdsm-tmpfiles.d.conf \ + %{buildroot}%{_tmpfilesdir}/%{vdsm_name}.conf %endif %if 0%{?rhel} @@ -620,7 +606,7 @@ install -Dm 0755 vdsm_reg/vdsm-reg.init %{buildroot}%{_initrddir}/vdsm-reg install -dDm 1777 %{buildroot}%{_localstatedir}/log/core %else # Install the configuration sample -install -Dm 0644 vdsm/vdsm.conf.sample \ +install -Dm 0644 lib/vdsm/vdsm.conf.sample \ %{buildroot}%{_sysconfdir}/vdsm/vdsm.conf # Install the polkit for libvirt @@ -663,24 +649,30 @@ if grep -q "# VDSM section begin" /etc/sysctl.conf; then /etc/sysctl.conf fi -# Make the /etc/sysctl.d/vdsm take effect immediately after installation. -/sbin/sysctl -q -p /etc/sysctl.d/vdsm - %if 0%{?rhel} if [ "$1" -eq 1 ] ; then /sbin/chkconfig --add vdsmd + /sbin/chkconfig --add supervdsmd + /sbin/chkconfig --add vdsm-restore-net-config fi %else +%if 0%{?with_systemd} +/bin/systemctl restart systemd-modules-load.service >/dev/null 2>&1 || : %if 0%{?with_systemd_macros} %systemd_post vdsmd.service +%systemd_post supervdsmd.service +%systemd_post vdsm-restore-net-config.service %else if [ "$1" -eq 1 ] ; then /bin/systemctl enable vdsmd.service >/dev/null 2>&1 || : + /bin/systemctl enable supervdsmd.service >/dev/null 2>&1 || : + /bin/systemctl enable vdsm-restore-net-config.service >/dev/null 2>&1 || : /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi exit 0 %endif %endif +%endif %preun if [ "$1" -eq 0 ]; then @@ -691,10 +683,14 @@ if [ "$1" -eq 0 ]; then /bin/sed -i -e "/${start_conf_section}/,/${end_conf_section}/d" \ -e "/${by_vdsm}/d" \ %{_sysconfdir}/libvirt/libvirtd.conf \ + %{_sysconfdir}/logrotate.d/libvirtd \ %{_sysconfdir}/libvirt/qemu.conf \ %{_sysconfdir}/sysconfig/libvirtd \ %{_sysconfdir}/sysctl.conf \ %{_sysconfdir}/libvirt/qemu-sanlock.conf + + # Restoring backuped logrotate.d/libvirtd + /bin/sed -i -e 's/# VDSM backup//' %{_sysconfdir}/logrotate.d/libvirtd fi %if 0%{?rhel} @@ -702,6 +698,9 @@ if [ "$1" -eq 0 ] then /sbin/service vdsmd stop > /dev/null 2>&1 || : /sbin/chkconfig --del vdsmd + /sbin/service supervdsmd stop > /dev/null 2>&1 || : + /sbin/chkconfig --del supervdsmd + /sbin/chkconfig --del vdsm-restore-net-config /bin/sed -i '/# VDSM section begin/,/# VDSM section end/d' \ /etc/sysctl.conf @@ -721,10 +720,15 @@ fi %else %if 0%{?with_systemd_macros} %systemd_preun vdsmd.service +%systemd_preun supervdsmd.service +%systemd_preun vdsm-restore-net-config.service %else if [ "$1" -eq 0 ]; then /bin/systemctl --no-reload disable vdsmd.service > /dev/null 2>&1 || : + /bin/systemctl --no-reload disable supervdsmd.service > /dev/null 2>&1 || : + /bin/systemctl --no-reload disable vdsm-restore-net-config.service > /dev/null 2>&1 || : /bin/systemctl stop vdsmd.service > /dev/null 2>&1 || : + /bin/systemctl stop supervdsmd.service > /dev/null 2>&1 || : fi exit 0 %endif @@ -734,14 +738,17 @@ exit 0 %if 0%{?rhel} if [ "$1" -ge 1 ]; then /sbin/service vdsmd condrestart > /dev/null 2>&1 + /sbin/service supervdsmd condrestart > /dev/null 2>&1 fi exit 0 %else %if 0%{?with_systemd_macros} %systemd_postun_with_restart vdsmd.service +%systemd_postun_with_restart supervdsmd.service %else if [ "$1" -ge 1 ] ; then /bin/systemctl try-restart vdsmd.service >/dev/null 2>&1 || : + /bin/systemctl try-restart supervdsmd.service >/dev/null 2>&1 || : fi exit 0 %endif @@ -797,18 +804,24 @@ exit 0 %files %defattr(-, root, root, -) -%doc COPYING README vdsm/vdsm.conf.sample +%doc COPYING README lib/vdsm/vdsm.conf.sample %if 0%{?with_systemd} /lib/systemd/systemd-vdsmd %{_unitdir}/vdsmd.service +%{_unitdir}/supervdsmd.service +%{_unitdir}/vdsm-restore-net-config.service %else %{_initrddir}/vdsmd +%{_initrddir}/supervdsmd +%{_initrddir}/vdsm-restore-net-config %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 %dir %{_libexecdir}/%{vdsm_name} +%dir %{_sysconfdir}/%{vdsm_name} +%dir %{_sysconfdir}/%{vdsm_name}/mom.d %dir %{_datadir}/%{vdsm_name} %dir %{_datadir}/%{vdsm_name}/storage %dir %{_datadir}/%{vdsm_name}/storage/imageRepository @@ -820,12 +833,13 @@ exit 0 %{_datadir}/%{vdsm_name}/API.py* %{_datadir}/%{vdsm_name}/hooking.py* %{_datadir}/%{vdsm_name}/hooks.py* -%{_datadir}/%{vdsm_name}/libvirtvm.py* %{_datadir}/%{vdsm_name}/lsblk.py* %{_datadir}/%{vdsm_name}/md_utils.py* %{_datadir}/%{vdsm_name}/mk_sysprep_floppy %{_datadir}/%{vdsm_name}/parted_utils.py* %{_datadir}/%{vdsm_name}/mkimage.py* +%{_datadir}/%{vdsm_name}/sourceRoute.py* +%{_datadir}/%{vdsm_name}/sourceRouteThread.py* %{_datadir}/%{vdsm_name}/supervdsm.py* %{_datadir}/%{vdsm_name}/supervdsmServer.py* %{_datadir}/%{vdsm_name}/vmChannels.py* @@ -834,23 +848,28 @@ exit 0 %{_datadir}/%{vdsm_name}/vdsm-restore-net-config %{_datadir}/%{vdsm_name}/vdsm-store-net-config %{_datadir}/%{vdsm_name}/vm.py* -%{_datadir}/%{vdsm_name}/write-net-config %{_datadir}/%{vdsm_name}/zombieReaper.py* -%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}/%{vdsm_name}/mom.d/*.policy %config(noreplace) %{_sysconfdir}/logrotate.d/vdsm %config(noreplace) %{_sysconfdir}/rwtab.d/vdsm %config(noreplace) %{_sysconfdir}/sysctl.d/vdsm +%if 0%{?with_systemd} +%config(noreplace) %{_sysconfdir}/modules-load.d/vdsm.conf +%endif +%if 0%{?with_tmpfiles_macro} +%config(noreplace) %{_tmpfilesdir}/%{vdsm_name}.conf +%endif +%{_sysconfdir}/dhcp/dhclient.d/sourceRoute.sh %{_sysconfdir}/sudoers.d/50_vdsm %{_sysconfdir}/cron.hourly/vdsm-logrotate %{_sysconfdir}/cron.d/vdsm-libvirt-logrotate %{_datadir}/%{vdsm_name}/guestIF.py* %{_datadir}/%{vdsm_name}/logUtils.py* %{_datadir}/%{vdsm_name}/dsaversion.py* +%{_libexecdir}/%{vdsm_name}/curl-img-wrap %{_libexecdir}/%{vdsm_name}/persist-vdsm-hooks %{_libexecdir}/%{vdsm_name}/unpersist-vdsm-hook %{_libexecdir}/%{vdsm_name}/ovirt_functions.sh @@ -858,6 +877,7 @@ exit 0 %{_datadir}/%{vdsm_name}/storage/__init__.py* %{_datadir}/%{vdsm_name}/storage/blockSD.py* %{_datadir}/%{vdsm_name}/storage/blockVolume.py* +%{_datadir}/%{vdsm_name}/storage/curlImgWrap.py* %{_datadir}/%{vdsm_name}/storage/devicemapper.py* %{_datadir}/%{vdsm_name}/storage/dispatcher.py* %{_datadir}/%{vdsm_name}/storage/domainMonitor.py* @@ -865,9 +885,16 @@ 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* +%{_datadir}/%{vdsm_name}/storage/imageSharing.py* %{_datadir}/%{vdsm_name}/storage/iscsiadm.py* %{_datadir}/%{vdsm_name}/storage/iscsi.py* %{_datadir}/%{vdsm_name}/storage/localFsSD.py* @@ -901,6 +928,10 @@ exit 0 %{_libexecdir}/%{vdsm_name}/safelease %{_libexecdir}/%{vdsm_name}/spmprotect.sh %{_libexecdir}/%{vdsm_name}/spmstop.sh +%dir %{_libexecdir}/%{vdsm_name}/hooks/before_device_create +%dir %{_libexecdir}/%{vdsm_name}/hooks/after_device_create +%dir %{_libexecdir}/%{vdsm_name}/hooks/before_device_destroy +%dir %{_libexecdir}/%{vdsm_name}/hooks/after_device_destroy %dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_start %dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_start %dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_cont @@ -911,6 +942,10 @@ exit 0 %dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_hibernate %dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_dehibernate %dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_dehibernate +%dir %{_libexecdir}/%{vdsm_name}/hooks/before_device_migrate_source +%dir %{_libexecdir}/%{vdsm_name}/hooks/after_device_migrate_source +%dir %{_libexecdir}/%{vdsm_name}/hooks/before_device_migrate_destination +%dir %{_libexecdir}/%{vdsm_name}/hooks/after_device_migrate_destination %dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_migrate_source %dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_migrate_source %dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_migrate_destination @@ -919,12 +954,19 @@ exit 0 %dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_destroy %dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_set_ticket %dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_set_ticket +%dir %{_libexecdir}/%{vdsm_name}/hooks/before_update_device +%dir %{_libexecdir}/%{vdsm_name}/hooks/after_update_device +%dir %{_libexecdir}/%{vdsm_name}/hooks/after_update_device_fail %dir %{_libexecdir}/%{vdsm_name}/hooks/before_nic_hotplug %dir %{_libexecdir}/%{vdsm_name}/hooks/after_nic_hotplug %dir %{_libexecdir}/%{vdsm_name}/hooks/before_nic_hotunplug %dir %{_libexecdir}/%{vdsm_name}/hooks/after_nic_hotunplug %dir %{_libexecdir}/%{vdsm_name}/hooks/after_nic_hotplug_fail %dir %{_libexecdir}/%{vdsm_name}/hooks/after_nic_hotunplug_fail +%dir %{_libexecdir}/%{vdsm_name}/hooks/before_disk_hotplug +%dir %{_libexecdir}/%{vdsm_name}/hooks/after_disk_hotplug +%dir %{_libexecdir}/%{vdsm_name}/hooks/before_disk_hotunplug +%dir %{_libexecdir}/%{vdsm_name}/hooks/after_disk_hotunplug %dir %{_libexecdir}/%{vdsm_name}/hooks/before_vdsm_start %dir %{_libexecdir}/%{vdsm_name}/hooks/after_vdsm_stop %{_datadir}/%{vdsm_name}/addNetwork @@ -935,9 +977,24 @@ exit 0 %{_datadir}/%{vdsm_name}/kaxmlrpclib.py* %{_datadir}/%{vdsm_name}/ksm.py* %{_datadir}/%{vdsm_name}/momIF.py* +%{_datadir}/%{vdsm_name}/netconf/__init__.py* +%{_datadir}/%{vdsm_name}/netconf/ifcfg.py* +%{_datadir}/%{vdsm_name}/netconf/libvirtCfg.py* +%{_datadir}/%{vdsm_name}/netconf/iproute2.py* %{_datadir}/%{vdsm_name}/neterrors.py* +%{_datadir}/%{vdsm_name}/netmodels.py* %{_datadir}/%{vdsm_name}/respawn +%{_datadir}/%{vdsm_name}/sampling.py* %{_datadir}/%{vdsm_name}/set-conf-item +%if 0%{?with_gluster} +%dir %{_datadir}/%{vdsm_name}/gluster +%{_datadir}/%{vdsm_name}/gluster/__init__.py* +%{_datadir}/%{vdsm_name}/gluster/cli.py* +%{_datadir}/%{vdsm_name}/gluster/exception.py* +%{_datadir}/%{vdsm_name}/gluster/hostname.py* +%else +%exclude %{_datadir}/%{vdsm_name}/gluster/* +%endif %{python_sitelib}/sos/plugins/vdsm.py* /lib/udev/rules.d/12-vdsm-lvm.rules /etc/security/limits.d/99-vdsm.conf @@ -962,7 +1019,9 @@ exit 0 %config(noreplace) %{_sysconfdir}/pki/%{vdsm_name}/keys/libvirt_password %dir %{_localstatedir}/lib/%{vdsm_name} %dir %{_localstatedir}/lib/%{vdsm_name}/netconfback -%ghost %dir %{_localstatedir}/run/%{vdsm_name} +%dir %{_localstatedir}/run/%{vdsm_name} +%dir %{_localstatedir}/run/%{vdsm_name}/sourceRoutes +%dir %{_localstatedir}/run/%{vdsm_name}/trackedInterfaces %ghost %dir %{_localstatedir}/run/%{vdsm_name}/pools %ghost %dir %{_localstatedir}/run/%{vdsm_name}/payload %dir %{_localstatedir}/log/%{vdsm_name} @@ -979,31 +1038,42 @@ exit 0 %{python_sitearch}/%{vdsm_name}/constants.py* %{python_sitearch}/%{vdsm_name}/define.py* %{python_sitearch}/%{vdsm_name}/exception.py* +%{python_sitearch}/%{vdsm_name}/ipwrapper.py* %{python_sitearch}/%{vdsm_name}/libvirtconnection.py* %{python_sitearch}/%{vdsm_name}/netinfo.py* %{python_sitearch}/%{vdsm_name}/qemuImg.py* %{python_sitearch}/%{vdsm_name}/SecureXMLRPCServer.py* %{python_sitearch}/%{vdsm_name}/utils.py* %{python_sitearch}/%{vdsm_name}/vdscli.py* -%{python_sitearch}/%{vdsm_name}/betterPopen/__init__.py* -%{python_sitearch}/%{vdsm_name}/betterPopen/createprocess.so %{python_sitearch}/%{vdsm_name}/tool/__init__.py* +%if 0%{?with_systemd} +%exclude %{python_sitearch}/%{vdsm_name}/tool/load_needed_modules.py* +%else %{python_sitearch}/%{vdsm_name}/tool/load_needed_modules.py* +%endif +%{python_sitearch}/%{vdsm_name}/tool/dummybr.py* +%{python_sitearch}/%{vdsm_name}/tool/nwfilter.py* +%{python_sitearch}/%{vdsm_name}/tool/libvirt_configure.py* +%{_libexecdir}/%{vdsm_name}/libvirt_configure.sh %{python_sitearch}/%{vdsm_name}/tool/passwd.py* +%{python_sitearch}/%{vdsm_name}/tool/sanlock.py* %{python_sitearch}/%{vdsm_name}/tool/seboolsetup.py* +%{python_sitearch}/%{vdsm_name}/tool/service.py* %{python_sitearch}/%{vdsm_name}/tool/validate_ovirt_certs.py* +%{python_sitearch}/%{vdsm_name}/tool/vdsm-id.py* %files tests %doc %{_datadir}/%{vdsm_name}/tests/README %defattr(-, root, root, -) %{_datadir}/%{vdsm_name}/tests/*.py* %{_datadir}/%{vdsm_name}/tests/cpu_info.out -%{_datadir}/%{vdsm_name}/tests/caps_libvirt.out +%{_datadir}/%{vdsm_name}/tests/caps_libvirt_intel_E5649.out +%{_datadir}/%{vdsm_name}/tests/caps_libvirt_amd_6274.out +%{_datadir}/%{vdsm_name}/tests/caps_libvirt_intel_E31220.out %{_datadir}/%{vdsm_name}/tests/glob_1c60971a-8647-44ac-ae33-6520887f8843.out %{_datadir}/%{vdsm_name}/tests/lvs_3386c6f2-926f-42c4-839c-38287fac8998.out %{_datadir}/%{vdsm_name}/tests/netmaskconversions %{_datadir}/%{vdsm_name}/tests/run_tests.sh -%{_datadir}/%{vdsm_name}/tests/route_info.out %{_datadir}/%{vdsm_name}/tests/tc_filter_show.out %if 0%{?with_gluster} %{_datadir}/%{vdsm_name}/tests/glusterVolumeProfileInfo.xml @@ -1013,6 +1083,20 @@ exit 0 %endif %{_datadir}/%{vdsm_name}/tests/functional/*.py* +%files hook-openstacknet +%defattr(-, root, root, -) +%{_sysconfdir}/sudoers.d/50_vdsm_hook_openstacknet +%{_libexecdir}/%{vdsm_name}/hooks/after_device_create/50_openstacknet +%{_libexecdir}/%{vdsm_name}/hooks/after_device_create/openstacknet_consts.py* +%{_libexecdir}/%{vdsm_name}/hooks/after_device_migrate_destination/50_openstacknet +%{_libexecdir}/%{vdsm_name}/hooks/after_device_migrate_destination/openstacknet_consts.py* +%{_libexecdir}/%{vdsm_name}/hooks/after_nic_hotplug/50_openstacknet +%{_libexecdir}/%{vdsm_name}/hooks/after_nic_hotplug/openstacknet_consts.py* +%{_libexecdir}/%{vdsm_name}/hooks/before_device_create/50_openstacknet +%{_libexecdir}/%{vdsm_name}/hooks/before_device_create/openstacknet_consts.py* +%{_libexecdir}/%{vdsm_name}/hooks/before_nic_hotplug/50_openstacknet +%{_libexecdir}/%{vdsm_name}/hooks/before_nic_hotplug/openstacknet_consts.py* + %files hook-vhostmd %defattr(-, root, root, -) %doc COPYING @@ -1028,6 +1112,10 @@ exit 0 %{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/50_qemucmdline %if 0%{?with_hooks} +%files hook-checkimages +%defattr(-, root, root, -) +%{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/60_checkimages + %files hook-directlun %defattr(-, root, root, -) %{_sysconfdir}/sudoers.d/50_vdsm_hook_directlun @@ -1063,6 +1151,10 @@ exit 0 %{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/50_isolatedprivatevlan %config(noreplace) %{_sysconfdir}/libvirt/nwfilter/isolatedprivatevlan-vdsm.xml +%files hook-macspoof +%defattr(-, root, root, -) +%{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/50_macspoof + %files hook-nestedvt %defattr(-, root, root, -) %{_sysconfdir}/modprobe.d/vdsm-nestedvt.conf @@ -1131,11 +1223,20 @@ exit 0 %defattr(-, root, root, -) %{_datadir}/%{vdsm_name}/BindingXMLRPC.py* +%files api +%doc vdsm_api/vdsm-api.html +%{_datadir}/%{vdsm_name}/vdsmapi-schema.json +%{python_sitelib}/vdsmapi.py* + %files jsonrpc %{_datadir}/%{vdsm_name}/BindingJsonRpc.py* %{_datadir}/%{vdsm_name}/Bridge.py* -%{_datadir}/%{vdsm_name}/vdsmapi.py* -%{_datadir}/%{vdsm_name}/vdsmapi-schema.json + +%files yajsonrpc +%{python_sitelib}/yajsonrpc/__init__.py* +%{python_sitelib}/yajsonrpc/asyncoreReactor.py* +%{python_sitelib}/yajsonrpc/protonReactor.py* +%{python_sitelib}/yajsonrpc/client.py* %files bootstrap %defattr(-, root, root, -) @@ -1179,8 +1280,6 @@ exit 0 %files hook-faqemu %defattr(-, root, root, -) %doc COPYING -%{_libexecdir}/%{vdsm_name}/vdsm-faqemu -%{_libexecdir}/%{vdsm_name}/hooks/after_vdsm_stop/10_faqemu %{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/10_faqemu %if 0%{?with_gluster} @@ -1188,17 +1287,21 @@ exit 0 %defattr(-, root, root, -) %dir %{_datadir}/%{vdsm_name}/gluster %doc COPYING -%{_datadir}/%{vdsm_name}/gluster/__init__.py* %{_datadir}/%{vdsm_name}/gluster/api.py* -%{_datadir}/%{vdsm_name}/gluster/cli.py* -%{_datadir}/%{vdsm_name}/gluster/exception.py* -%{_datadir}/%{vdsm_name}/gluster/hostname.py* -%else -%exclude %{_datadir}/%{vdsm_name}/gluster/* +%{_datadir}/%{vdsm_name}/gluster/vdsmapi-gluster-schema.json +%{_datadir}/%{vdsm_name}/gluster/hooks.py* +%{_datadir}/%{vdsm_name}/gluster/services.py* %endif +%files python-cpopen +%{python_sitearch}/cpopen/__init__.py* +%attr(755, root, root) %{python_sitearch}/cpopen/cpopen.so* + %changelog +* Tue Jul 23 2013 Federico Simoncelli 4.12.0-0.1.rc3 +- update to vdsm-4.12.0-rc3 + * Wed Jul 10 2013 Douglas Schilling Landgraf 4.10.3-18 - vdsm.spec: update python-pthreading - service: make iscsid a systemd dependency