Change in vdsm[master]: netinfo: replace the last dependency on ethtool with netlink
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: netinfo: replace the last dependency on ethtool with netlink
......................................................................
netinfo: replace the last dependency on ethtool with netlink
After the last work on the lib/vdsm/netlink package and the
extensive usage of it throughout netinfo, there was little
reason to continue to have two libraries for our network
information gathering.
Change-Id: I32bc77d2af0fd973b31f77003652daa0912edfe4
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M lib/vdsm/netinfo.py
1 file changed, 7 insertions(+), 12 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/01/29601/1
diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index a412425..a204f72 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -33,8 +33,6 @@
import struct
from xml.dom import minidom
-import ethtool
-
from .config import config
from . import constants
from .ipwrapper import drv_name
@@ -842,17 +840,14 @@
def getDeviceByIP(ip):
"""
Get network device by IP address
- :param ip: String representing IPv4 or IPv6, but not link-local IPv6
+ :param ip: String representing IPv4 or IPv6
"""
- for info in ethtool.get_interfaces_info(ethtool.get_active_devices()):
- for ipv4addr in info.get_ipv4_addresses():
- if ip in (ipv4addr.address, IPv4toMapped(ipv4addr.address)):
- return info.device
-
- for ipv6addr in info.get_ipv6_addresses():
- if ip == ipv6addr.address:
- return info.device
-
+ for addr in nl_addr.iter_addrs():
+ address = addr['address'].split('/')[0]
+ if ((addr['family'] == 'inet' and
+ ip in (address, IPv4toMapped(address))) or (
+ addr['family'] == 'inet6' and ip == addr)):
+ return addr['label']
return ''
--
To view, visit http://gerrit.ovirt.org/29601
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I32bc77d2af0fd973b31f77003652daa0912edfe4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
9 years, 11 months
Change in vdsm[ovirt-3.5]: hsm: deleteImage - lock image by imgUUID and sdUUID
by derez@redhat.com
Hello Nir Soffer, Federico Simoncelli,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/29656
to review the following change.
Change subject: hsm: deleteImage - lock image by imgUUID and sdUUID
......................................................................
hsm: deleteImage - lock image by imgUUID and sdUUID
hsm -> deleteImage:
An image can reside on two storage domains concurrently
(e.g. during LSM flow: between syncImage and deleteImage phases).
Hence, deleting an image should take an exclusive lock on both
image and storage domain IDs.
I.e. since the image can exist on two storage domains concurrently,
we cannot take both exclusive locks with the same name.
Note: the modified lock in this patch is the only one uses merely an
image UUID.
Change-Id: I057b1f680276b1eb8a5d910260b7db4c4236fbf5
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1097648
Signed-off-by: Daniel Erez <derez(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/28264
Reviewed-by: Nir Soffer <nsoffer(a)redhat.com>
Reviewed-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/56/29656/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 7769ae7..1ebbd4a 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1491,7 +1491,10 @@
pool = self.getPool(spUUID)
dom = sdCache.produce(sdUUID=sdUUID)
- vars.task.getExclusiveLock(STORAGE, imgUUID)
+ # Taking an exclusive lock on both imgUUID and sdUUID since
+ # an image can exist on two SDs concurrently (e.g. during LSM flow);
+ # hence, we need a unique identifier.
+ vars.task.getExclusiveLock(STORAGE, "%s_%s", imgUUID, sdUUID)
vars.task.getSharedLock(STORAGE, sdUUID)
allVols = dom.getAllVolumes()
volsByImg = sd.getVolsOfImage(allVols, imgUUID)
--
To view, visit http://gerrit.ovirt.org/29656
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I057b1f680276b1eb8a5d910260b7db4c4236fbf5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
9 years, 11 months
Change in vdsm[master]: virt: introduce a XML processing module
by fromani@redhat.com
Francesco Romani has posted comments on this change.
Change subject: virt: introduce a XML processing module
......................................................................
Patch Set 4:
split into a patchset to make review easier and faster and to not needlessly block the QoS patchset on unrelated things.
--
To view, visit http://gerrit.ovirt.org/26855
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I77dd048067b8abcb77f4b9bf55fbfd0535672996
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpoledni(a)redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
9 years, 11 months
Change in vdsm[master]: virt: move XML processing in a module
by mpoledni@redhat.com
Martin Polednik has posted comments on this change.
Change subject: virt: move XML processing in a module
......................................................................
Patch Set 3: Code-Review+1
I'd say the name itself sounds better, I'm only afraid not to start naming everything vm* as that would be redundant. Related question: should we really use _domParseStr or new from_string when outside of vm.py we use ParseString?
--
To view, visit http://gerrit.ovirt.org/26855
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I77dd048067b8abcb77f4b9bf55fbfd0535672996
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpoledni(a)redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
9 years, 11 months
Change in vdsm[master]: network: Reset bonding options we did not modify to defaults...
by osvoboda@redhat.com
Ondřej Svoboda has uploaded a new change for review.
Change subject: network: Reset bonding options we did not modify to defaults (WIP)
......................................................................
network: Reset bonding options we did not modify to defaults (WIP)
This is an attempt to have bonds configured with exactly
the options that were requested.
The handling of mode 4 options (if they are options at all?)
is yet to be investigated. I suspect the also belong to the set
of run-time values we should not even report as bonding options.
Change-Id: I884b7436e12df9dc8572694f886a3c7eb32de200
Bug-Url: https://bugzilla.redhat.com/987813
Signed-off-by: Ondřej Svoboda <osvoboda(a)redhat.com>
---
M vdsm/network/models.py
1 file changed, 37 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/74/26374/1
diff --git a/vdsm/network/models.py b/vdsm/network/models.py
index ced0a30..a44c24c 100644
--- a/vdsm/network/models.py
+++ b/vdsm/network/models.py
@@ -190,6 +190,41 @@
def __repr__(self):
return 'Bond(%s: %r)' % (self.name, self.slaves)
+ def _confOptions(self):
+ return [option.split('=', 1) for option in self.options.split(' ')]
+
+ def replaceCurrentOptsWithDefaults(self):
+ '''
+ Any active non-default value not touched by options being currently
+ set is added so it is explicitly reset to its default.
+
+ This is intended to make sure no other options than those we modified
+ have non-default values.
+ '''
+ activeOpts = netinfo._getBondingOptions(self.name)
+
+ defaults, defaultMode = netinfo._getDefaultBondingOptions()
+ mode = (activeOpts['mode'][-1] if 'mode' in activeOpts
+ else defaultMode[-1])
+ defaults = defaults[mode]
+
+ confOpts = dict(self._confOptions())
+
+ for key in activeOpts:
+ if key not in confOpts:
+ logging.error('Clearing pre-existing non-default %s option'
+ ' (%s=%s)', self.name, key, activeOpts[key])
+
+ if key in defaults:
+ activeOpts[key] = defaults[key][-1]
+ else:
+ logging.error('No default value found! '
+ 'The mode is %s.', mode)
+ activeOpts[key] = ''
+
+ activeOpts.update(confOpts)
+ return netinfo._bondOptsForIfcfg(activeOpts)
+
def configure(self, **opts):
# When the bond is up and we are not changing the configuration that
# is already applied in any way, we can skip the configuring.
@@ -203,10 +238,11 @@
frozenset(netinfo.slaves(self.name))):
return
+ self.options = self.resetUnwantedOptions()
self.configurator.configureBond(self, **opts)
def areOptionsApplied(self):
- confOpts = [option.split('=', 1) for option in self.options.split(' ')]
+ confOpts = self._confOpts()
activeOpts = netinfo.bondOpts(self.name,
(name for name, value in confOpts))
return all(value in activeOpts[name] for name, value in confOpts)
--
To view, visit http://gerrit.ovirt.org/26374
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I884b7436e12df9dc8572694f886a3c7eb32de200
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
9 years, 11 months
Change in vdsm[master]: vdsm: Shuting down protocol detector fails
by Nir Soffer
Nir Soffer has posted comments on this change.
Change subject: vdsm: Shuting down protocol detector fails
......................................................................
Patch Set 3:
(1 comment)
http://gerrit.ovirt.org/#/c/29556/3/vdsm/protocoldetector.py
File vdsm/protocoldetector.py:
Line 164: os.write(self._write_fd, '1')
Line 165: except OSError as e:
Line 166: if e.errno == errno.EINTR:
Line 167: self.wakeup()
Line 168: elif e.errno not in (errno.EAGAIN, errno.EWOULDBLOCK. errno.EPIPE):
Error handling should be little different now, since failure to write to the pipe means that the acceptor will not stop. Now it stop only when receiving the "1" byte on the other side, while before it was using the running flag, and the pipe was used only for wakeup.
I would replace this to ignore EPIPE (read_fd closed) and EBADF (write_fd closed) and try again on EINTR.
EAGAIN and EWOULDBLOCK should never happen on this always empty pipe so maybe it would be better to raise in this impossible case.
Something like:
while True:
try:
os.write(self._write_fd, "1")
except OSError as e:
if e.errno in (errno.EPIPE, errno.EBADF):
return # Was already stopped
if e.errno != errno.EINTR:
raise
else:
return
Line 169: raise
Line 170:
Line 171: def _cleanup_wakeup_pipe(self):
Line 172: try:
--
To view, visit http://gerrit.ovirt.org/29556
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I82119a61835fe335f2aa5da29fb8d3f2b8ae33fc
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
9 years, 11 months