[vdsm/f18] vdsm-4.10.3-17 - Makefile.am: ignore false positive pyflakes lvm.py - Deactivate libvirtVM.Drives()
Douglas Schilling Landgraf
dougsland at fedoraproject.org
Wed Jun 5 03:15:28 UTC 2013
commit 3db360a6bd2a453b9bbb6c7f4c98b44b570d65f6
Author: Douglas Schilling Landgraf <dougsland at redhat.com>
Date: Wed Jun 5 00:14:49 2013 -0300
vdsm-4.10.3-17
- Makefile.am: ignore false positive pyflakes lvm.py
- Deactivate libvirtVM.Drives()
- vdsm: fix Vm cleanup routine
- Support teardownVolumePath(None)
....am-ignore-false-positive-pyflakes-lvm.py.patch | 38 +++++++
0049-Deactivate-libvirtVM.Drives.patch | 79 +++++++++++++++
0050-vdsm-fix-Vm-cleanup-routine.patch | 106 ++++++++++++++++++++
0051-Support-teardownVolumePath-None.patch | 45 ++++++++
vdsm.spec | 12 ++-
5 files changed, 279 insertions(+), 1 deletions(-)
---
diff --git a/0048-Makefile.am-ignore-false-positive-pyflakes-lvm.py.patch b/0048-Makefile.am-ignore-false-positive-pyflakes-lvm.py.patch
new file mode 100644
index 0000000..41735b7
--- /dev/null
+++ b/0048-Makefile.am-ignore-false-positive-pyflakes-lvm.py.patch
@@ -0,0 +1,38 @@
+From 96c4ae5b46a83cd7099fd2a0558e2be7e8831d3a Mon Sep 17 00:00:00 2001
+From: Douglas Schilling Landgraf <dougsland at redhat.com>
+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 <dougsland at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/14184
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+---
+ 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
new file mode 100644
index 0000000..24aa19b
--- /dev/null
+++ b/0049-Deactivate-libvirtVM.Drives.patch
@@ -0,0 +1,79 @@
+From b94d0a6c37303a977a46fe95ee77a2dd287d862c Mon Sep 17 00:00:00 2001
+From: Eduardo Warszawski <ewarszaw at redhat.com>
+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 <ewarszaw at redhat.com>
+Signed-off-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/14869
+Reviewed-on: http://gerrit.ovirt.org/14953
+Tested-by: Federico Simoncelli <fsimonce at redhat.com>
+---
+ 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
new file mode 100644
index 0000000..a13a6a6
--- /dev/null
+++ b/0050-vdsm-fix-Vm-cleanup-routine.patch
@@ -0,0 +1,106 @@
+From 0939dd0d8c23067f6c74d722a07c46623f57a6da Mon Sep 17 00:00:00 2001
+From: Peter V. Saveliev <peet at redhat.com>
+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 <peet at redhat.com>
+Change-Id: Ie355022866d008a83257b1b6e3a4226a07d34c2f
+Reviewed-on: http://gerrit.ovirt.org/13610
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-by: Vered Volansky <vvolansk at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/15055
+Tested-by: Federico Simoncelli <fsimonce at redhat.com>
+---
+ 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
new file mode 100644
index 0000000..421d1a5
--- /dev/null
+++ b/0051-Support-teardownVolumePath-None.patch
@@ -0,0 +1,45 @@
+From 617ff7d9e577c0c09bbe277543a0cf28120b6f4f Mon Sep 17 00:00:00 2001
+From: Eduardo Warszawski <ewarszaw at redhat.com>
+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 <ewarszaw at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/15316
+Reviewed-by: Federico Simoncelli <fsimonce at redhat.com>
+Reviewed-by: Douglas Schilling Landgraf <dougsland at redhat.com>
+Reviewed-by: Vinzenz Feenstra <vfeenstr at redhat.com>
+Reviewed-by: Dan Kenigsberg <danken at redhat.com>
+Tested-by: Dan Kenigsberg <danken at redhat.com>
+Reviewed-on: http://gerrit.ovirt.org/15353
+Tested-by: Federico Simoncelli <fsimonce at redhat.com>
+---
+ 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/vdsm.spec b/vdsm.spec
index 7a37557..26054a2 100644
--- a/vdsm.spec
+++ b/vdsm.spec
@@ -45,7 +45,7 @@
Name: %{vdsm_name}
Version: 4.10.3
-Release: 16%{?vdsm_relvtag}%{?dist}%{?extra_release}
+Release: 17%{?vdsm_relvtag}%{?dist}%{?extra_release}
Summary: Virtual Desktop Server Manager
Group: Applications/System
@@ -110,6 +110,10 @@ 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
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -1184,6 +1188,12 @@ exit 0
%changelog
+* Tue Jun 4 2013 Douglas Schilling Landgraf <dougsland at redhat.com> 4.10.3-17
+- Makefile.am: ignore false positive pyflakes lvm.py
+- Deactivate libvirtVM.Drives()
+- vdsm: fix Vm cleanup routine
+- Support teardownVolumePath(None)
+
* Tue Apr 23 2013 Federico Simoncelli <fsimonce at redhat.com> 4.10.3-16
- Don't user sudo in fuser
- svdsm: fix fuser import in supervdsmServer
More information about the scm-commits
mailing list