Change in vdsm[master]: configNet: allow delete/update of devices with no ifcfg
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: configNet: allow delete/update of devices with no ifcfg
......................................................................
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.
Change-Id: Icb3a623ca3d3b560288cbe4141eea6bd060ac798
Bug-Url: https://bugzilla.redhat.com/906383
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M tests/configNetworkTests.py
M vdsm/configNetwork.py
2 files changed, 25 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/21/11621/1
diff --git a/tests/configNetworkTests.py b/tests/configNetworkTests.py
index 0a129b9..41164b2 100644
--- a/tests/configNetworkTests.py
+++ b/tests/configNetworkTests.py
@@ -344,3 +344,7 @@
cw.restorePersistentBackup()
self._assertFilesRestored()
+
+ def test_getMTUofMissingDev(self):
+ cw = configNetwork.ConfigWriter()
+ self.assertIs(cw._getDeviceConfigMtu('DEVICE.DOES.NOT.EXIST'), None)
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 5380f31..d43f2a9 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -618,13 +618,29 @@
it check if a vlan, bond that have a higher mtu value
"""
for nic in nics:
- cf = netinfo.NET_CONF_PREF + nic
- mtuval = self._getConfigValue(cf, 'MTU')
+ mtuval = self._getDeviceConfigMtu(nic)
+
if not mtuval is None:
mtuval = int(mtuval)
if mtuval > mtu:
mtu = mtuval
return mtu
+
+ def _getDeviceConfigMtu(self, dev):
+ "Return custom MTU from ifcfg of device or None if none is set"
+ cf = self.NET_CONF_PREF + dev
+ try:
+ currmtu = self._getConfigValue(cf, 'MTU')
+ except IOError as e:
+ if e.errno == os.errno.ENOENT:
+ currmtu = None
+ else:
+ raise
+
+ if currmtu:
+ currmtu = int(currmtu)
+
+ return currmtu
def setNewMtu(self, network, bridged):
"""
@@ -641,11 +657,9 @@
_netinfo = netinfo.NetInfo()
currmtu = None
if bridged:
- cf = netinfo.NET_CONF_PREF + network
- currmtu = self._getConfigValue(cf, 'MTU')
- if currmtu:
- currmtu = int(currmtu)
- else:
+ currmtu = self._getDeviceConfigMtu(network)
+
+ if not currmtu:
# Optimization: if network hasn't custom MTU, do nothing
return
--
To view, visit http://gerrit.ovirt.org/11621
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb3a623ca3d3b560288cbe4141eea6bd060ac798
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
11 years, 3 months
Change in vdsm[master]: VDSM should return qemu-kvm parameters by getCaps API in all...
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: VDSM should return qemu-kvm parameters by getCaps API in all distributions
......................................................................
VDSM should return qemu-kvm parameters by getCaps API in all distributions
Engine reads qemu-kvm parameter and set it as kvm version. Over RHEL we
called this parameter qemu-kvm-rhev due to the name of kvm package. This
patch adds dictionary that translate between the package name and the
key value.
Change-Id: I97448ea5265ab2f3fa51e76762d5727c2a78ce3b
Bug-Id: https://bugzilla.redhat.com/show_bug.cgi?id=901421
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm/caps.py
1 file changed, 21 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/76/11676/1
diff --git a/vdsm/caps.py b/vdsm/caps.py
index a307200..392e7e0 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -328,20 +328,31 @@
pkgs = {'kernel': kernelDict()}
+ # Settting deafule keys and values. Engine reads those keys and the values
+ # are the names of the packages - which are different between
+ # distributions.
+ KEY_PACKAGES = {'qemu-kvm': 'qemu-kvm',
+ 'qemu-img': 'qemu-img',
+ 'vdsm': 'vdsm',
+ 'spice-server': 'spice-server',
+ 'libvirt': 'libvirt',
+ 'mom': 'mom'}
+
if getos() in (OSName.RHEVH, OSName.OVIRT, OSName.FEDORA, OSName.RHEL):
- KEY_PACKAGES = ['qemu-kvm', 'qemu-img',
- 'vdsm', 'spice-server', 'libvirt', 'mom']
+ if getos() in (OSName.RHEVH, OSName.RHEL):
+ KEY_PACKAGES['qemu-kvm'] = 'qemu-kvm-rhev'
+ KEY_PACKAGES['qemu-img'] = 'qemu-img-rhev'
try:
ts = rpm.TransactionSet()
- for pkg in KEY_PACKAGES:
+ for key, pkg in KEY_PACKAGES.items():
try:
mi = ts.dbMatch('name', pkg).next()
except StopIteration:
logging.debug("rpm package %s not found", pkg)
else:
- pkgs[pkg] = {
+ pkgs[key] = {
'version': mi['version'],
'release': mi['release'],
'buildtime': mi['buildtime'],
@@ -350,18 +361,19 @@
logging.error('', exc_info=True)
elif getos() == OSName.DEBIAN and python_apt:
- KEY_PACKAGES = {'qemu-kvm': 'qemu-kvm', 'qemu-img': 'qemu-utils',
- 'vdsm': 'vdsmd', 'spice-server': 'libspice-server1',
- 'libvirt': 'libvirt0', 'mom': 'mom'}
+ KEY_PACKAGES['qemu-img'] = 'qemu-utils'
+ KEY_PACKAGES['vdsm'] = 'vdsmd'
+ KEY_PACKAGES['spice-server'] = 'libspice-server1'
+ KEY_PACKAGES['libvirt'] = 'libvirt0'
cache = apt.Cache()
- for pkg in KEY_PACKAGES:
+ for key, pkg in KEY_PACKAGES.items():
try:
deb_pkg = KEY_PACKAGES[pkg]
ver = cache[deb_pkg].installed.version
# Debian just offers a version
- pkgs[pkg] = dict(version=ver, release="", buildtime="")
+ pkgs[key] = dict(version=ver, release="", buildtime="")
except:
logging.error('', exc_info=True)
--
To view, visit http://gerrit.ovirt.org/11676
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I97448ea5265ab2f3fa51e76762d5727c2a78ce3b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
11 years, 3 months
Change in vdsm[master]: doc: Solved sphinx-build import errors.
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: doc: Solved sphinx-build import errors.
......................................................................
Patch Set 3:
why's the empty bug-url in the comment?
--
To view, visit http://gerrit.ovirt.org/11652
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I836210fa5bbd844c20b3b5444be24cd9fa4023e2
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Vallarelli <giuseppevallarelli(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <giuseppevallarelli(a)gmail.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
11 years, 3 months
Change in vdsm[master]: doc: Solved sphinx-build import errors.
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: doc: Solved sphinx-build import errors.
......................................................................
Patch Set 2: I would prefer that you didn't submit this
(2 inline comments)
Thanks for the new revision!
....................................................
File doc/create_sl.sh
Line 1: #!/bin/bash
Line 2:
Line 3: # Adds a symoblic link for vdscli in vdsm if not present.
Line 4: VDSCLI=$(readlink -f "../vdsm/vdscli.py")
Line 5: if [ ! -e $VDSCLI ] ; then
still using unquoted variable
Line 6: ln -s ../vdsm_cli/vdscli.py $VDSCLI
....................................................
File doc/Makefile
Line 11: PAPEROPT_a4 = -D latex_paper_size=a4
Line 12: PAPEROPT_letter = -D latex_paper_size=letter
Line 13: ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
Line 14:
Line 15: export PYTHONPATH=../vdsm
this seems a bit too broadly effective. I'd prefer setting a more specific
SPHINXBUILD = PYTHONPATH=../vdsm:$$PYTHONPATH sphinx-build
if it is indeed needed.
Line 16:
Line 17: .PHONY: help clean html htmlstrict dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
Line 18:
Line 19: help:
--
To view, visit http://gerrit.ovirt.org/11652
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I836210fa5bbd844c20b3b5444be24cd9fa4023e2
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Vallarelli <giuseppevallarelli(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <giuseppevallarelli(a)gmail.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
11 years, 3 months
Change in vdsm[master]: doc: updated conf.py and different *.rst files with new refe...
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: doc: updated conf.py and different *.rst files with new references.
......................................................................
Patch Set 1: (1 inline comment)
....................................................
File doc/storage/SPM.rst
Line 1: Documentation for the Storage Pool Manager
Line 2: ******************************************
Line 3:
Line 4: .. automodule:: storage.sp
this is certainly not your fault, but it would be best just to remove SPM.rst file. The module it used to document is not dead and gone,
--
To view, visit http://gerrit.ovirt.org/11628
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I78a66de2182e75d413212bceb47453127fdb07f8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Vallarelli <giuseppevallarelli(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
11 years, 3 months