Change in vdsm[ovirt-3.5]: Live Merge: Get volume chain for multiple drives
by alitke@redhat.com
Hello Federico Simoncelli, Dan Kenigsberg, Francesco Romani,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/32322
to review the following change.
Change subject: Live Merge: Get volume chain for multiple drives
......................................................................
Live Merge: Get volume chain for multiple drives
A future patch wants to get volume chain information for all drives in
one call. Rather than getting the domXML once per drive, allow
_driveGetActualVolumeChain to accept a list of drives and parse the
information all at once.
Change-Id: I93d5a641b0814e3764c70bea8a6c1910a821adcc
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1109920
Signed-off-by: Adam Litke <alitke(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/31366
Reviewed-by: Francesco Romani <fromani(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
Reviewed-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 42 insertions(+), 34 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/32322/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 63a2d00..0811723 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -5668,8 +5668,8 @@
return errCode['imageErr']
# Check that libvirt exposes full volume chain information
- chain = self._driveGetActualVolumeChain(drive)
- if chain is None:
+ chains = self._driveGetActualVolumeChain([drive])
+ if drive['alias'] not in chains:
self.log.error("merge: libvirt does not support volume chain "
"monitoring. Unable to perform live merge.")
return errCode['mergeErr']
@@ -5745,53 +5745,59 @@
return {'status': doneCode}
- def _lookupDeviceXMLByAlias(self, targetAlias):
- domXML = self._getUnderlyingVmInfo()
- devices = _domParseStr(domXML).childNodes[0]. \
- getElementsByTagName('devices')[0]
+ def _diskXMLGetVolumeChainInfo(self, diskXML, drive):
+ def find_element_by_name(doc, name):
+ for child in doc.childNodes:
+ if child.nodeName == name:
+ return child
+ return None
- for deviceXML in devices.childNodes:
- if deviceXML.nodeType != Node.ELEMENT_NODE:
- continue
-
- aliasElement = deviceXML.getElementsByTagName('alias')
- if aliasElement:
- alias = aliasElement[0].getAttribute('name')
-
- if alias == targetAlias:
- return deviceXML
- return None
-
- def _driveGetActualVolumeChain(self, drive):
def pathToVolID(drive, path):
for vol in drive.volumeChain:
if os.path.realpath(vol['path']) == os.path.realpath(path):
return vol['volumeID']
raise LookupError("Unable to find VolumeID for path '%s'", path)
- def findElement(doc, name):
- for child in doc.childNodes:
- if child.nodeName == name:
- return child
- return None
-
- diskXML = self._lookupDeviceXMLByAlias(drive['alias'])
- if not diskXML:
- return None
volChain = []
while True:
- sourceXML = findElement(diskXML, 'source')
+ sourceXML = find_element_by_name(diskXML, 'source')
if not sourceXML:
break
sourceAttr = ('file', 'dev')[drive.blockDev]
path = sourceXML.getAttribute(sourceAttr)
entry = VolumeChainEntry(pathToVolID(drive, path), path)
- volChain.insert(0, entry)
- bsXML = findElement(diskXML, 'backingStore')
+ bsXML = find_element_by_name(diskXML, 'backingStore')
if not bsXML:
+ self.log.warning("<backingStore/> missing from backing "
+ "chain for drive %s", drive.name)
break
diskXML = bsXML
- return volChain
+ volChain.insert(0, entry)
+ return volChain or None
+
+ def _driveGetActualVolumeChain(self, drives):
+ def lookupDeviceXMLByAlias(domXML, targetAlias):
+ domObj = xml.dom.minidom.parseString(domXML)
+ devices = domObj.childNodes[0].getElementsByTagName('devices')[0]
+ for deviceXML in devices.childNodes:
+ if deviceXML.nodeType == xml.dom.Node.ELEMENT_NODE:
+ aliasElement = deviceXML.getElementsByTagName('alias')
+ if aliasElement:
+ alias = aliasElement[0].getAttribute('name')
+ if alias == targetAlias:
+ return deviceXML
+ raise LookupError("Unable to find matching XML for device %s",
+ targetAlias)
+
+ ret = {}
+ domXML = self._getUnderlyingVmInfo()
+ for drive in drives:
+ alias = drive['alias']
+ diskXML = lookupDeviceXMLByAlias(domXML, alias)
+ volChain = self._diskXMLGetVolumeChainInfo(diskXML, drive)
+ if volChain:
+ ret[alias] = volChain
+ return ret
def _syncVolumeChain(self, drive):
def getVolumeInfo(device, volumeID):
@@ -5805,8 +5811,10 @@
return
curVols = [x['volumeID'] for x in drive.volumeChain]
- chain = self._driveGetActualVolumeChain(drive)
- if chain is None:
+ chains = self._driveGetActualVolumeChain([drive])
+ try:
+ chain = chains[drive['alias']]
+ except KeyError:
self.log.debug("Unable to determine volume chain. Skipping volume "
"chain synchronization for drive %s", drive.name)
return
--
To view, visit http://gerrit.ovirt.org/32322
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I93d5a641b0814e3764c70bea8a6c1910a821adcc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
9 years, 8 months
Change in vdsm[ovirt-3.5]: qemuimg: Handle new output format
by alitke@redhat.com
Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/32321
to review the following change.
Change subject: qemuimg: Handle new output format
......................................................................
qemuimg: Handle new output format
The current qemu-img info parsing logic assumes that if the output is
long enough, the backing image will appear on line 6. In newer qemu
versions, some additional information has been added to the output. In
the case of no backing file, the additional lines will fail to parse.
Handle this by trying to parse line 6 as a backing file and ignoring
regex parse errors for this line only.
Sample output from qemu-2.0.0-rc1:
[alitke@lager qemu-2.0.0-rc1]$ ./qemu-img info base.img
image: base.img
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 196K
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
[alitke@lager qemu-2.0.0-rc1]$ ./qemu-img info leaf.img
image: leaf.img
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 196K
cluster_size: 65536
backing file: base.img
Format specific information:
compat: 1.1
lazy refcounts: false
Change-Id: Ic229198ab7c2bb9743bdf8629416131186115431
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1127294
Signed-off-by: Adam Litke <alitke(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/27552
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M lib/vdsm/qemuimg.py
M tests/Makefile.am
A tests/qemuimgTests.py
3 files changed, 138 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/21/32321/1
diff --git a/lib/vdsm/qemuimg.py b/lib/vdsm/qemuimg.py
index 28ecc87..3cdec8d 100644
--- a/lib/vdsm/qemuimg.py
+++ b/lib/vdsm/qemuimg.py
@@ -44,9 +44,18 @@
'offset': re.compile("^Image end offset: (?P<value>\d+)$"),
}
+INFO_OPTFIELDS_STARTIDX = 4 # qemu-img info optional fields start in this line
+
+
+class _RegexSearchError(Exception):
+ pass
+
def __iregexSearch(pattern, text):
- return __iregex[pattern].search(text).group("value")
+ m = __iregex[pattern].search(text)
+ if m is None:
+ raise _RegexSearchError()
+ return m.group("value")
class QImgError(Exception):
@@ -78,15 +87,19 @@
'format': __iregexSearch("format", out[1]),
'virtualsize': int(__iregexSearch("virtualsize", out[2])),
}
-
- if len(out) > 4:
- info['clustersize'] = int(__iregexSearch("clustersize", out[4]))
-
- if len(out) > 5:
- info['backingfile'] = __iregexSearch("backingfile", out[5])
- except:
+ except _RegexSearchError:
raise QImgError(rc, out, err, "unable to parse qemu-img info output")
+ # Scan for optional fields in the output
+ row = INFO_OPTFIELDS_STARTIDX
+ for field, filterFn in (('clustersize', int), ('backingfile', str)):
+ try:
+ info[field] = filterFn(__iregexSearch(field, out[row]))
+ except (_RegexSearchError, IndexError):
+ pass
+ else:
+ row = row + 1
+
return info
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6507165..378a69f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -62,6 +62,7 @@
permutationTests.py \
persistentDictTests.py \
profileTests.py \
+ qemuimgTests.py \
remoteFileHandlerTests.py \
resourceManagerTests.py \
samplingTests.py \
diff --git a/tests/qemuimgTests.py b/tests/qemuimgTests.py
new file mode 100644
index 0000000..4a35694
--- /dev/null
+++ b/tests/qemuimgTests.py
@@ -0,0 +1,116 @@
+#
+# Copyright 2014 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 textwrap
+from functools import partial
+
+from testrunner import VdsmTestCase as TestCaseBase
+import monkeypatch
+from vdsm import qemuimg
+from vdsm import utils
+
+
+def fakeCmd(txt, *args, **kwargs):
+ txt = textwrap.dedent(txt).split('\n')
+ if txt[0] == '':
+ txt.pop(0)
+ return (0, txt, '')
+
+
+outputParseError = """
+foo bar
+"""
+
+
+outputQemu1NoBackingFile = """
+image: base.img
+file format: qcow2
+virtual size: 1.0G (1073741824 bytes)
+disk size: 196K
+cluster_size: 65536
+"""
+
+
+outputQemu1Backing = """
+image: leaf.img
+file format: qcow2
+virtual size: 1.0G (1073741824 bytes)
+disk size: 196K
+cluster_size: 65536
+backing file: base.img (actual path: /tmp/base.img)
+"""
+
+
+outputQemu2NoBackingFile = """
+image: base.img
+file format: qcow2
+virtual size: 1.0G (1073741824 bytes)
+disk size: 196K
+cluster_size: 65536
+Format specific information:
+ compat: 1.1
+ lazy refcounts: false
+"""
+
+
+outputQemu2BackingNoCluster = """
+image: leaf.img
+file format: qcow2
+virtual size: 1.0G (1073741824 bytes)
+disk size: 196K
+backing file: base.img (actual path: /tmp/base.img)
+Format specific information:
+ compat: 1.1
+ lazy refcounts: false
+"""
+
+
+class qemuimgTests(TestCaseBase):
+ @monkeypatch.MonkeyPatch(utils, 'execCmd',
+ partial(fakeCmd, outputParseError))
+ def testParseError(self):
+ self.assertRaises(qemuimg.QImgError, qemuimg.info, 'unused')
+
+ @monkeypatch.MonkeyPatch(utils, 'execCmd',
+ partial(fakeCmd, outputQemu1NoBackingFile))
+ def testQemu1NoBackingFile(self):
+ info = qemuimg.info('unused')
+ self.assertNotIn('backingfile', info)
+
+ @monkeypatch.MonkeyPatch(utils, 'execCmd',
+ partial(fakeCmd, outputQemu1Backing))
+ def testQemu1Backing(self):
+ info = qemuimg.info('unused')
+ self.assertEquals('base.img', info['backingfile'])
+
+ @monkeypatch.MonkeyPatch(utils, 'execCmd',
+ partial(fakeCmd, outputQemu2NoBackingFile))
+ def testQemu2NoBackingFile(self):
+ info = qemuimg.info('unused')
+ self.assertEquals('qcow2', info['format'])
+ self.assertEquals(1073741824, info['virtualsize'])
+ self.assertEquals(65536, info['clustersize'])
+ self.assertNotIn('backingfile', info)
+
+ @monkeypatch.MonkeyPatch(utils, 'execCmd',
+ partial(fakeCmd, outputQemu2BackingNoCluster))
+ def testQemu2BackingNoCluster(self):
+ info = qemuimg.info('unused')
+ self.assertEquals('base.img', info['backingfile'])
--
To view, visit http://gerrit.ovirt.org/32321
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic229198ab7c2bb9743bdf8629416131186115431
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
9 years, 8 months
Change in vdsm[ovirt-3.5]: Live Merge: Update path using libvirt supplied value
by alitke@redhat.com
Hello Nir Soffer, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/32320
to review the following change.
Change subject: Live Merge: Update path using libvirt supplied value
......................................................................
Live Merge: Update path using libvirt supplied value
When libvirt pivots the active layer after a live merge, the live XML is
updated to reflect the path of the new active layer. The new path is
copied from the backingStore pointer of the old active layer. Since
that is a relative path, libvirt makes it absolute but it will not
remove the '../' path component since that is not always correct (even
though it would be correct for our environment). When syncing the
volume chain, we must use the same path as libvirt does, otherwise
future calls to libvirt may fail.
Change-Id: Ie341333ad934645c0fe4f2fd31733c459d306d9a
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1109920
Signed-off-by: Adam Litke <alitke(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/31365
Reviewed-by: Nir Soffer <nsoffer(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 8 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/20/32320/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 7017eef..63a2d00 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -215,7 +215,7 @@
pass
-VolumeChainEntry = namedtuple('VolumeChainEntry', ['uuid'])
+VolumeChainEntry = namedtuple('VolumeChainEntry', ['uuid', 'path'])
class VmStatsThread(sampling.AdvancedStatsThread):
@@ -5785,7 +5785,7 @@
break
sourceAttr = ('file', 'dev')[drive.blockDev]
path = sourceXML.getAttribute(sourceAttr)
- entry = VolumeChainEntry(pathToVolID(drive, path))
+ entry = VolumeChainEntry(pathToVolID(drive, path), path)
volChain.insert(0, entry)
bsXML = findElement(diskXML, 'backingStore')
if not bsXML:
@@ -5812,6 +5812,7 @@
return
volumes = [entry.uuid for entry in chain]
+ activePath = chain[-1].path
self.log.debug("vdsm chain: %s, libvirt chain: %s", curVols, volumes)
# Ask the storage to sync metadata according to the new chain
@@ -5829,9 +5830,13 @@
# If the active layer changed:
# Update the disk path, volumeID, and volumeInfo members
volInfo = getVolumeInfo(device, volumeID)
- device['path'] = drive.path = volInfo['path']
+ # Path must be set with the value being used by libvirt
+ device['path'] = drive.path = volInfo['path'] = activePath
device['volumeID'] = drive.volumeID = volumeID
device['volumeInfo'] = drive.volumeInfo = volInfo
+ for v in device['volumeChain']:
+ if v['volumeID'] == volumeID:
+ v['path'] = activePath
# Remove any components of the volumeChain which are no longer present
newChain = [x for x in device['volumeChain']
--
To view, visit http://gerrit.ovirt.org/32320
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie341333ad934645c0fe4f2fd31733c459d306d9a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
9 years, 8 months
Change in vdsm[ovirt-3.5]: Live Merge: Return more info from _driveGetActualVolumeChain
by alitke@redhat.com
Hello Nir Soffer, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/32319
to review the following change.
Change subject: Live Merge: Return more info from _driveGetActualVolumeChain
......................................................................
Live Merge: Return more info from _driveGetActualVolumeChain
In followup patches, we want to return more information about each path
component from _driveGetActualVolumeChain. We need the actual path as
given in the domain XML in order to properly update our metadata after
an active layer merge. We also want to use this function to return high
write watermark information for block volumes. This patch just converts
the format returned by _driveGetActualVolumeChain from a simple list to
a list of named tuples.
Change-Id: I01d142a68903048accc95eb04d9930c326965db0
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1109920
Signed-off-by: Adam Litke <alitke(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/31364
Reviewed-by: Nir Soffer <nsoffer(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 12 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/19/32319/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 4806dab..7017eef 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -20,6 +20,7 @@
# stdlib imports
+from collections import namedtuple
from contextlib import contextmanager
from copy import deepcopy
from operator import itemgetter
@@ -212,6 +213,9 @@
class UpdatePortMirroringError(Exception):
pass
+
+
+VolumeChainEntry = namedtuple('VolumeChainEntry', ['uuid'])
class VmStatsThread(sampling.AdvancedStatsThread):
@@ -5555,8 +5559,7 @@
except LookupError:
newJob = {'jobID': jobID, 'disk': driveSpec,
'baseVolume': base, 'topVolume': top,
- 'strategy': strategy, 'blockJobType': 'commit',
- 'chain': self._driveGetActualVolumeChain(drive)}
+ 'strategy': strategy, 'blockJobType': 'commit'}
self.conf['_blockJobs'][jobID] = newJob
else:
self.log.error("Cannot add block job %s. A block job with id "
@@ -5665,7 +5668,8 @@
return errCode['imageErr']
# Check that libvirt exposes full volume chain information
- if self._driveGetActualVolumeChain(drive) is None:
+ chain = self._driveGetActualVolumeChain(drive)
+ if chain is None:
self.log.error("merge: libvirt does not support volume chain "
"monitoring. Unable to perform live merge.")
return errCode['mergeErr']
@@ -5781,7 +5785,8 @@
break
sourceAttr = ('file', 'dev')[drive.blockDev]
path = sourceXML.getAttribute(sourceAttr)
- volChain.insert(0, pathToVolID(drive, path))
+ entry = VolumeChainEntry(pathToVolID(drive, path))
+ volChain.insert(0, entry)
bsXML = findElement(diskXML, 'backingStore')
if not bsXML:
break
@@ -5800,12 +5805,13 @@
return
curVols = [x['volumeID'] for x in drive.volumeChain]
- volumes = self._driveGetActualVolumeChain(drive)
- if volumes is None:
+ chain = self._driveGetActualVolumeChain(drive)
+ if chain is None:
self.log.debug("Unable to determine volume chain. Skipping volume "
"chain synchronization for drive %s", drive.name)
return
+ volumes = [entry.uuid for entry in chain]
self.log.debug("vdsm chain: %s, libvirt chain: %s", curVols, volumes)
# Ask the storage to sync metadata according to the new chain
--
To view, visit http://gerrit.ovirt.org/32319
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I01d142a68903048accc95eb04d9930c326965db0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
9 years, 8 months
Change in vdsm[ovirt-3.5]: iface_sampling: Fix debug logging samples
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: iface_sampling: Fix debug logging samples
......................................................................
iface_sampling: Fix debug logging samples
Currently we have a debug logging entry whenever the tx/rx rates go
over 100%. In this log, we try to help debugging of the issue by
printing the sample value of rx and tx for all the samples in the
AVERAGING_WINDOW (size 5).
The problem comes from the fact that the decision to log is taken
by checking samples hs0 and hs1 iterating over all the devices
existing on the older hs1. However, there is no guarantee that
the devices would exist in hs2, hs3, ..., hs_AVERAGING_WINDOW.
The fix is to simply not include the samples for which the device
is missing.
Change-Id: Ibaa80f5fe069875d8e48deb1783f102b2da8f39d
Bug-Url: https://bugzilla.redhat.com/1116577
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/29916
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
Reviewed-by: Francesco Romani <fromani(a)redhat.com>
Tested-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/virt/sampling.py
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/31789/1
diff --git a/vdsm/virt/sampling.py b/vdsm/virt/sampling.py
index 4cefc19..d6bef32 100644
--- a/vdsm/virt/sampling.py
+++ b/vdsm/virt/sampling.py
@@ -650,7 +650,8 @@
interval, thisRx, thisTx,
[(hs.timestamp, hs.interfaces[ifid].rx,
hs.interfaces[ifid].tx)
- for hs in self._samples])
+ for hs in self._samples if
+ ifid in hs.interfaces])
iface = hs1.interfaces[ifid]
stats['network'][ifid] = {'name': ifid, 'speed': str(ifrate),
'rxDropped': str(iface.rxDropped),
--
To view, visit http://gerrit.ovirt.org/31789
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibaa80f5fe069875d8e48deb1783f102b2da8f39d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
9 years, 8 months
Change in vdsm[ovirt-3.5]: hsm: check volume existence in prepareImage
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: hsm: check volume existence in prepareImage
......................................................................
hsm: check volume existence in prepareImage
This patch introduces a check in prepareImage to return a consistent
error (VolumeDoesNotExist) when the volume to prepare is not found.
Before this patch the error was:
UnboundLocalError: local variable 'leafInfo' referenced
before assignment
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1133617
Change-Id: Iceac3934b5eb3b7d3d68ea80ddd29cd9fe919c6c
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/31937
Reviewed-by: Allon Mureinik <amureini(a)redhat.com>
Reviewed-by: Nir Soffer <nsoffer(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
(cherry picked from commit 0e9c6a4fb2f126d10d445289753abbf03ed867ae)
---
M vdsm/storage/hsm.py
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/37/32337/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index d743759..413a604 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3208,6 +3208,10 @@
allVols = dom.getAllVolumes()
# Filter volumes related to this image
imgVolumes = sd.getVolsOfImage(allVols, imgUUID).keys()
+
+ if leafUUID not in imgVolumes:
+ raise se.VolumeDoesNotExist(leafUUID)
+
imgPath = dom.activateVolumes(imgUUID, imgVolumes)
if spUUID and spUUID != sd.BLANK_UUID:
runImgPath = dom.linkBCImage(imgPath, imgUUID)
--
To view, visit http://gerrit.ovirt.org/32337
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iceac3934b5eb3b7d3d68ea80ddd29cd9fe919c6c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
9 years, 8 months
Change in vdsm[ovirt-3.5]: netinfo: Return Mac of bond slaves in lower case
by gcheresh@redhat.com
Genadi Chereshnya has uploaded a new change for review.
Change subject: netinfo: Return Mac of bond slaves in lower case
......................................................................
netinfo: Return Mac of bond slaves in lower case
getVdsCaps returns MAC of all interfaces in lower case and for bond slaves
it returned it in upper cases - fixing inconsistency
Change-Id: Ibbd431b73fa1f381a897b6550e2b398009c0a7b9
Bug-Url: https://bugzilla.redhat.com/1116810
Signed-off-by: Genadi Chereshnya <gcheresh(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/31888
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
(cherry picked from commit bd4a297c25fc5d6e241d28ca5eb0fb2b4c538e6e)
---
M lib/vdsm/netinfo.py
1 file changed, 1 insertion(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/32289/1
diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index 7bd8075..5dc2cd6 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -518,8 +518,7 @@
if line.startswith('Slave Interface: '):
slave = line[len('Slave Interface: '):-1]
if line.startswith('Permanent HW addr: '):
- addr = line[len('Permanent HW addr: '):-1]
- paddr[slave] = addr.upper()
+ paddr[slave] = line[len('Permanent HW addr: '):-1]
return paddr
--
To view, visit http://gerrit.ovirt.org/32289
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibbd431b73fa1f381a897b6550e2b398009c0a7b9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Genadi Chereshnya <gcheresh(a)redhat.com>
9 years, 8 months
Change in vdsm[ovirt-3.5]: Remove redundant prints during rpm installation
by ybronhei@redhat.com
Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/32170
to review the following change.
Change subject: Remove redundant prints during rpm installation
......................................................................
Remove redundant prints during rpm installation
Those stdout prints are invalid and doesn't assist to the user.
If configure fails vdsmd won't start and the user will need to
investigate it. But stdout prints in the installation phase won't
assist.
Change-Id: I5284009f1f04382b0cae73a16d1650d54d7649ea
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/30667
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/70/32170/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index ecac369..8650294 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -704,7 +704,7 @@
/usr/sbin/usermod -a -G %{cdrom_group} %{qemu_user}
%post
-%{_bindir}/vdsm-tool configure --module sanlock --force
+%{_bindir}/vdsm-tool configure --module sanlock --force >/dev/null
%{_bindir}/vdsm-tool sebool-config || :
# set the vdsm "secret" password for libvirt
%{_bindir}/vdsm-tool set-saslpasswd
--
To view, visit http://gerrit.ovirt.org/32170
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5284009f1f04382b0cae73a16d1650d54d7649ea
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
9 years, 8 months
Change in vdsm[master]: hsm: check volume existence in prepareImage
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: hsm: check volume existence in prepareImage
......................................................................
hsm: check volume existence in prepareImage
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1133617
Change-Id: Iceac3934b5eb3b7d3d68ea80ddd29cd9fe919c6c
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/37/31937/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 6a53ca7..ab48be8 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3227,6 +3227,10 @@
allVols = dom.getAllVolumes()
# Filter volumes related to this image
imgVolumes = sd.getVolsOfImage(allVols, imgUUID).keys()
+
+ if leafUUID not in imgVolumes:
+ raise se.VolumeDoesNotExist(leafUUID)
+
imgPath = dom.activateVolumes(imgUUID, imgVolumes)
if spUUID and spUUID != sd.BLANK_UUID:
runImgPath = dom.linkBCImage(imgPath, imgUUID)
--
To view, visit http://gerrit.ovirt.org/31937
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iceac3934b5eb3b7d3d68ea80ddd29cd9fe919c6c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
9 years, 8 months