Hello Antoni Segura Puimedon, Amador Pahim,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/21982
to review the following change.
Change subject: deployUtil: expect integer vlan id from new netinfo
......................................................................
deployUtil: expect integer vlan id from new netinfo
Commit 8b2bbe6e5 changed netinfo.getVlanID() to return the vlan id as an
integer, istead of a string. This makes a lot of sense, but breaks
compatibility with ancient deployUtil code.
Change-Id: Ibc1c5875e0d13b110f61f9eabf6d1964fc4c1237
Bug-Url: https://bugzilla.redhat.com/1037277
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/21948
Reviewed-by: Amador Pahim <apahim(a)redhat.com>
Reviewed-by: Antoni Segura Puimedon <asegurap(a)redhat.com>
---
M vdsm_reg/deployUtil.py.in
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/82/21982/1
diff --git a/vdsm_reg/deployUtil.py.in b/vdsm_reg/deployUtil.py.in
index 2d379f6..ba45d64 100644
--- a/vdsm_reg/deployUtil.py.in
+++ b/vdsm_reg/deployUtil.py.in
@@ -1061,6 +1061,7 @@
else:
vlan, bonding, nic = _getRHELBridgeParams(mgtIface,
bridgeName=bridgeName)
+ vlan = str(vlan)
fReturn = (nic is not None)
#Delete existing bridge in oVirt
--
To view, visit http://gerrit.ovirt.org/21982
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc1c5875e0d13b110f61f9eabf6d1964fc4c1237
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Amador Pahim <apahim(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Wenchao Xia has uploaded a new change for review.
Change subject: adjust betterPopenTest.py
......................................................................
adjust betterPopenTest.py
The main function in betterPopenTest is used to check result
after popen, it should not include the betterPopen and test class
code. If it include and the directory it lies on changes, the
import will fail, which means additional python settings should be
passed to betterPopen making things more complicate.
Change-Id: I3059df6abb5c261f45720fc1a3b5266314c62e79
Signed-off-by: wenchao xia <xiawenc(a)linux.vnet.ibm.com>
---
M tests/betterPopenTests.py
1 file changed, 50 insertions(+), 51 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/85/4585/1
--
To view, visit http://gerrit.ovirt.org/4585
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3059df6abb5c261f45720fc1a3b5266314c62e79
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Wenchao Xia <xiawenc(a)linux.vnet.ibm.com>
Nir Soffer has uploaded a new change for review.
Change subject: sp: Fix stopping domain monitors
......................................................................
sp: Fix stopping domain monitors
Commit 2671777c69 fixed stopping of domain monitors by stopping monitors from
StoragePool.__del__. This was a dangerous fix because a stray reference to the
pool may delay invocation of __del__ until the referring object is deleted,
delaying stopping of domain monitors for unlimited time. In case of a memory
leak, the pool may never be deleted and domain monitors would never stop.
Fortunately, this fix did seem to work for couple of years, until commit
7b1cc6a20f made the domain monitor pool independent. Instead of one domain
monitor object per pool, there is now a single shared domain monitor object
used by all pool objects. Having a shared domain monitor, the pool __del__
method became deadly.
Shortly after commit 7b1cc6a20f was merged, a new random error appeared in CI
jobs, where there is no storage space left, while storage has plenty of space.
The root cause of the error was anonymous thread running at unexpected times
and stopping silently all domain monitors. Adding some logging revealed that
this thread was started from StoragePool.__del__ method. This thread was
running 14 minutes after the original pool was disconnected, stopping domain
monitors used by the current pool object. It seems that a task was holding a
reference to the old pool, and when the task was finished, the old pool was
finally destroyed.
We seem to stop monitoring when we should, and stopping monitoring in
the __del__ method is redundant. This patch removes the deadly method.
Change-Id: Iad80984ab44dd4a4e36b92330eb9320cf68f1580
Relates-To: https://bugzilla.redhat.com/705058
Relates-To: http://gerrit.ovirt.org/19762
Bug-Url: https://bugzilla.redhat.com/1032925
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/storage/sp.py
1 file changed, 0 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/58/22058/1
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 31e0bcd..91b27d5 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -140,10 +140,6 @@
def getSpmStatus(self):
return self.spmRole, self.getSpmLver(), self.getSpmId()
- def __del__(self):
- if len(self.domainMonitor.poolMonitoredDomains) > 0:
- threading.Thread(target=self.stopMonitoringDomains).start()
-
@unsecured
def forceFreeSpm(self):
# DO NOT USE, STUPID, HERE ONLY FOR BC
--
To view, visit http://gerrit.ovirt.org/22058
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad80984ab44dd4a4e36b92330eb9320cf68f1580
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Dan Kenigsberg has posted comments on this change.
Change subject: vdsm: Handling topology for ppc64
......................................................................
Patch Set 7: Code-Review-1
(3 comments)
....................................................
Commit Message
Line 8:
Line 9: This change adds the method to extract the topology from a specific
Line 10: command for ppc64 machines. The current method for x86_64 hasn't
Line 11: been changed.
Line 12: Due libvirt shows wrong information about ppc64 topology, the lscpu
Please include a URL to the relevant libvirt bug. Ovirt may need to circumvent this in the short term, but let's make it easy to revert this patch when the libvirt bug is solved.
Line 13: command is being used to obtain it.
Line 14: The topology tests were changed to be executed in a mock
Line 15: architecture and new test cases were added to handle ppc64 methods.
Line 16:
....................................................
File tests/Makefile.am
Line 91: cpu_info.out \
Line 92: caps_libvirt_intel_E5649.out \
Line 93: caps_libvirt_amd_6274.out \
Line 94: caps_libvirt_intel_E31220.out \
Line 95: caps_lscpu_ppc64_1_4_4.out \
Makefiles love tabs.
Line 96: caps_lscpu_ppc64_2_4_8.out \
Line 97: glob_1c60971a-8647-44ac-ae33-6520887f8843.out \
Line 98: glusterVolumeProfileInfo.xml \
Line 99: glusterVolumeProfileInfoNfs.xml \
....................................................
File tests/capsTests.py
Line 61: testPath = os.path.realpath(__file__)
Line 62: dirName = os.path.split(testPath)[0]
Line 63: # PPC64 1 socket, 4 cores, 4 threads per core
Line 64: path = os.path.join(dirName, "caps_lscpu_ppc64_1_4_4.out")
Line 65: t = caps.CpuTopology(file(path).read())
file() is no longer cool. Use open().
Line 66: self.assertEqual(t.threads(), 16)
Line 67: self.assertEqual(t.cores(), 4)
Line 68: self.assertEqual(t.sockets(), 4)
Line 69: # PPC64 2 sockets, 8 cores, 8 threads per core
--
To view, visit http://gerrit.ovirt.org/19875
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I048d4a6c083392d63fbcff76453e682b9d6f03fc
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Leonardo Bianconi <leonardo.bianconi(a)eldorado.org.br>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Gustavo Frederico Temple Pedrosa <gustavo.pedrosa(a)eldorado.org.br>
Gerrit-Reviewer: Leonardo Bianconi <leonardo.bianconi(a)eldorado.org.br>
Gerrit-Reviewer: Vitor de Lima <vitor.lima(a)eldorado.org.br>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-HasComments: Yes
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: ip monitor: replace pairwise with grouper
......................................................................
ip monitor: replace pairwise with grouper
pairwise takes an iterator or elements '123456789' and generates an
iterator that gives: ('1', '2'), ('2', '3'), ('3', '4'), ('4', '5')...
grouper takes an iterator or elements '123456789' and generates an
iterator that gives: [('1', '2'), ('3', '4'), ('5', '6'), ('7', '8'), ('9',
None)]
Since the data to parse from iproute2 commands is structured closer
to grouper, change to that.
Change-Id: Ie1c569cee85c2d4fd54cbd8e6d964c2291056c6c
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M lib/vdsm/ipwrapper.py
M lib/vdsm/utils.py
2 files changed, 8 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/22092/1
diff --git a/lib/vdsm/ipwrapper.py b/lib/vdsm/ipwrapper.py
index 676bdba..394e9a4 100644
--- a/lib/vdsm/ipwrapper.py
+++ b/lib/vdsm/ipwrapper.py
@@ -31,7 +31,7 @@
from .utils import CommandPath
from .utils import execCmd
from .utils import memoized
-from .utils import pairwise
+from .utils import grouper
_IP_BINARY = CommandPath('ip', '/sbin/ip')
_ETHTOOL_BINARY = CommandPath('ethtool',
@@ -118,7 +118,7 @@
baseData = (el for el in values.strip().split(' ') if el and
el != 'link/none')
- for key, value in pairwise(baseData):
+ for key, value in grouper(baseData, 2):
if key.startswith('link/'):
key = 'address'
attrs[key] = value
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index fb2c03d..966e1f3 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -983,12 +983,12 @@
# Copied from
-# http://docs.python.org/2.6/library/itertools.html?highlight=pairwise#recipes
-def pairwise(iterable):
- "s -> (s0,s1), (s1,s2), (s2, s3), ..."
- a, b = itertools.tee(iterable)
- next(b, None)
- return itertools.izip(a, b)
+# http://docs.python.org/2.6/library/itertools.html?highlight=grouper#recipes
+def grouper(iterable, n, fillvalue=None):
+ "Collect data into fixed-length chunks or blocks"
+ # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx
+ args = [iter(iterable)] * n
+ return itertools.izip_longest(fillvalue=fillvalue, *args)
def anyFnmatch(name, patterns):
--
To view, visit http://gerrit.ovirt.org/22092
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1c569cee85c2d4fd54cbd8e6d964c2291056c6c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: netinfo: Introduce linkPool
......................................................................
netinfo: Introduce linkPool
linkPool is a dictionary that always contains the device links
present in the system as keys.
The values are initially Link objects but when an event is received
the event is put on place of the link object (this is likely to
change into keeping Link objects, but if it is the case, it will
be in a follow up patch).
This linkPool will be used for various things.
- The sampling thread will always know which devices to report.
- Netinfo object creation will be significantly cheaper if
it the links are on memory.
Change-Id: I819a4b271955baaf14b3d12883ccfe7fda90b7d1
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M lib/vdsm/netinfo.py
1 file changed, 24 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/57/22057/1
diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index edc1c13..0af9b8d 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -27,6 +27,7 @@
import shlex
import socket
import struct
+import threading
from xml.dom import minidom
import ethtool
@@ -35,6 +36,7 @@
from . import constants
from .ipwrapper import getLink, getLinks
from .ipwrapper import IPRoute2Error
+from .ipwrapper import Monitor
from .ipwrapper import Route
from .ipwrapper import routeGet
from .ipwrapper import routeShowAllDefaultGateways
@@ -68,6 +70,28 @@
OPERSTATE_UP = 'up'
+linkPool = {}
+
+
+def _linkPoolUpdater():
+ mon = Monitor()
+ mon.start()
+ for event in mon:
+ if event.state == Monitor.LINK_STATE_DELETED:
+ try:
+ del linkPool[event.device]
+ except KeyError:
+ logging.debug('Failed to remove link pool device %s which was '
+ 'not on the pool', event.device)
+ else:
+ linkPool[event.device] = event
+
+
+# netinfo link pool handling
+for link in getLinks():
+ linkPool[link.name] = link
+threading.Thread(target=_linkPoolUpdater, name='linkPool').start()
+
def nics():
"""Returns a list of nics and fake nics devices available (not hidden) to
--
To view, visit http://gerrit.ovirt.org/22057
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I819a4b271955baaf14b3d12883ccfe7fda90b7d1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Francesco Romani has uploaded a new change for review.
Change subject: vm: janitorial: replace file() with open()
......................................................................
vm: janitorial: replace file() with open()
As per docs, open() is preferred to file():
http://docs.python.org/2/library/functions.html#file
moreover, file() was removed in python3:
http://docs.python.org/release/3.0/whatsnew/3.0.html#builtins
Change-Id: I39c604b53e812a838542c94349cb64c272bea552
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/34/22034/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index b037d3c..4be5466 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -244,7 +244,7 @@
fname = self._vm.cif.prepareVolumePath(self._dstparams)
try:
- with file(fname, "w") as f:
+ with open(fname, "w") as f:
pickle.dump(self._machineParams, f)
finally:
self._vm.cif.teardownVolumePath(self._dstparams)
@@ -3795,7 +3795,7 @@
vmConfVolPath = self.cif.prepareVolumePath(vmConfVol)
vmConf = _vmConfForMemorySnapshot()
try:
- with file(vmConfVolPath, "w") as f:
+ with open(vmConfVolPath, "w") as f:
pickle.dump(vmConf, f)
finally:
self.cif.teardownVolumePath(vmConfVol)
--
To view, visit http://gerrit.ovirt.org/22034
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I39c604b53e812a838542c94349cb64c272bea552
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>