Hello Juan Hernandez, Yaniv Bronhaim,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/20936
to review the following change.
Change subject: Avoid M2Crypto races
......................................................................
Avoid M2Crypto races
As documented in
http://www.heikkitoivonen.net/m2crypto/api/M2Crypto.threading-module.html
and painfully recognized long ago in https://bugzilla.redhat.com/482420,
using M2Crypto in a multi-threaded server such as Vdsm requires explicit
initialization.
Bug-Url: https://bugzilla.redhat.com/1026556
Change-Id: I83a3ab41a7001758bd37b0124904fbcd0387ffbf
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/20813
Reviewed-by: Juan Hernandez <juan.hernandez(a)redhat.com>
Reviewed-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M lib/vdsm/SecureXMLRPCServer.py
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/36/20936/1
diff --git a/lib/vdsm/SecureXMLRPCServer.py b/lib/vdsm/SecureXMLRPCServer.py
index f60baef..7e3563a 100644
--- a/lib/vdsm/SecureXMLRPCServer.py
+++ b/lib/vdsm/SecureXMLRPCServer.py
@@ -35,10 +35,13 @@
import SocketServer
import logging
+import M2Crypto
from M2Crypto import SSL, X509
from vdsm.utils import IPXMLRPCRequestHandler, IPXMLRPCServer
+M2Crypto.threading.init()
+
SecureXMLRPCRequestHandler = IPXMLRPCRequestHandler
--
To view, visit http://gerrit.ovirt.org/20936
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I83a3ab41a7001758bd37b0124904fbcd0387ffbf
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Vinzenz Feenstra has uploaded a new change for review.
Change subject: Update of the guest memory stats schema
......................................................................
Update of the guest memory stats schema
Newer guest agent versions are now additionally reporting swap stats. This
needs to be reflected in the schema.
Change-Id: Ic6326ecac58e459cc73b87274cb18e8a3cf2ab41
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1025845
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
---
M vdsm_api/vdsmapi-schema.json
1 file changed, 19 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/20959/1
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 72848f8..a6469fb 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -5265,27 +5265,37 @@
#
# Memory statistics as reported by the guest agent.
#
-# @mem_total: The total amount of memory available to the OS (in KiB)
+# @mem_total: The total amount of memory available to the OS
+# (in KiB)
#
-# @mem_unused: The amount of memory that is completely unused (in KiB)
+# @mem_unused: The amount of memory that is completely unused
+# (in KiB)
#
-# @mem_free: The amount of memory available for allocation in KiB (includes
-# easily reclaimable memory)
+# @mem_free: The amount of memory available for allocation in
+# KiB (includes easily reclaimable memory)
#
-# @swap_in: The number of memory pages swapped in since the last collection
+# @swap_in: The number of memory pages swapped in since the
+# last collection
#
-# @swap_out: The number of memory pages swapped out since the last collection
+# @swap_out: The number of memory pages swapped out since the
+# last collection
#
-# @pageflt: The number of page faults since the last collection
+# @pageflt: The number of page faults since the last collection
#
-# @majflt: The number of major page faults since the last collection
+# @majflt: The number of major page faults since the last
+# collection
+#
+# @swap_total: #optional The total amount of swap space available to the OS
+# (in KiB)
+#
+# @swap_usage: #optional The amount of swap space used by the OS (in KiB)
#
# Since: 4.10.0
##
{'type': 'GuestMemoryStats',
'data': {'mem_total': 'str', 'mem_unused': 'str', 'mem_free': 'str',
'swap_in': 'uint', 'swap_out': 'uint', 'pageflt': 'uint',
- 'majflt': 'uint'}}
+ 'majflt': 'uint', '*swap_total': 'str', '*swap_usage': 'str'}}
##
# @BalloonInfo:
--
To view, visit http://gerrit.ovirt.org/20959
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic6326ecac58e459cc73b87274cb18e8a3cf2ab41
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Shu Ming has uploaded a new change for review.
Change subject: Get oop from object instance
......................................................................
Get oop from object instance
In FileStorageDomain non-class method, self.oop should
be used instead of oop
Change-Id: Ia6b86f2c5e382774003772837e32bd62f8ad29ce
Signed-off-by: Shu Ming <shuming(a)linux.vnet.ibm.com>
---
M vdsm/storage/fileSD.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/20/8920/1
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index f92ed98..7d6e1ab 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -177,7 +177,7 @@
def getReadDelay(self):
t = time.time()
- oop.getProcessPool(self.sdUUID).directReadLines(self.metafile)
+ self.oop.getProcessPool(self.sdUUID).directReadLines(self.metafile)
return time.time() - t
def getFileList(self, pattern, caseSensitive):
--
To view, visit http://gerrit.ovirt.org/8920
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6b86f2c5e382774003772837e32bd62f8ad29ce
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shu Ming <shuming(a)linux.vnet.ibm.com>
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: cleanup: Improve networking imports (PEP328)
......................................................................
cleanup: Improve networking imports (PEP328)
PEP328 ( http://www.python.org/dev/peps/pep-0328/ ) does away with
the ambiguity of where the modules that are being imported reside
making the codebase much more browsable.
With a codebase of:
package/
__init__.py
subpackage1/
__init__.py
moduleX.py
moduleY.py
subpackage2/
__init__.py
moduleZ.py
moduleA.py
this (moduleY.py):
import moduleX
import moduleZ
becomes
from . import moduleX
from ..subpackage2 import moduleZ
Which makes it much more evident where things are and avoids possible
shadowing of packages in site-packages.
Change-Id: I249cfa0ad734ea45ecbbecbade9daeed6c3adc12
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M lib/vdsm/ipwrapper.py
M lib/vdsm/netconfpersistence.py
M lib/vdsm/netinfo.py
M vdsm/configNetwork.py
M vdsm/netconf/__init__.py
M vdsm/netconf/ifcfg.py
M vdsm/netconf/iproute2.py
M vdsm/netconf/libvirtCfg.py
M vdsm/netmodels.py
M vdsm/sourceRoute.py
M vdsm/sourceRouteThread.py
M vdsm/tc.py
M vdsm/vdsm-restore-net-config
13 files changed, 77 insertions(+), 71 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/55/20555/1
diff --git a/lib/vdsm/ipwrapper.py b/lib/vdsm/ipwrapper.py
index cf0c069..a3455de 100644
--- a/lib/vdsm/ipwrapper.py
+++ b/lib/vdsm/ipwrapper.py
@@ -16,6 +16,7 @@
#
# Refer to the README and COPYING files for full details of the license
#
+from __future__ import absolute_import
from collections import namedtuple
@@ -23,8 +24,8 @@
from netaddr import IPAddress
from netaddr import IPNetwork
-from utils import CommandPath
-from utils import execCmd
+from .utils import CommandPath
+from .utils import execCmd
_IP_BINARY = CommandPath('ip', '/sbin/ip')
diff --git a/lib/vdsm/netconfpersistence.py b/lib/vdsm/netconfpersistence.py
index 633cb94..34c9ea8 100644
--- a/lib/vdsm/netconfpersistence.py
+++ b/lib/vdsm/netconfpersistence.py
@@ -17,16 +17,17 @@
#
# Refer to the README and COPYING files for full details of the license
#
+from __future__ import absolute_import
import errno
import json
import logging
import os
-from config import config
-from tool.restore_nets import restore
-import constants
-import utils
+from .config import config
+from .tool.restore_nets import restore
+from . import constants
+from . import utils
CONF_RUN_DIR = constants.P_VDSM_RUN + 'netconf/'
diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index 60088d4..1c41802 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -17,27 +17,26 @@
#
# Refer to the README and COPYING files for full details of the license
#
+from __future__ import absolute_import
from collections import namedtuple
-import errno
from fnmatch import fnmatch
from glob import iglob
from itertools import chain
+from xml.dom import minidom
+import errno
import logging
import os
import shlex
import socket
import struct
-from xml.dom import minidom
import ethtool
-from config import config
-import constants
-from ipwrapper import Route
-from ipwrapper import routeShowAllDefaultGateways
-import libvirtconnection
-from ipwrapper import linkShowDev
+from .config import config
+from . import constants
+from . import libvirtconnection
+from .ipwrapper import linkShowDev, Route, routeShowAllDefaultGateways
NET_CONF_DIR = '/etc/sysconfig/network-scripts/'
# ifcfg persistence directories
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 3894691..06a7e9e 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -16,32 +16,24 @@
#
# Refer to the README and COPYING files for full details of the license
#
+from __future__ import absolute_import
from functools import wraps
import inspect
-import sys
-import os
-import traceback
-import time
import logging
+import os
+import sys
+import time
+import traceback
+from . import hooks
+from . import neterrors as ne
+from .netconf.ifcfg import ConfigWriter, Ifcfg
+from .neterrors import ConfigNetworkError
+from .netmodels import Bond, Bridge, IPv4, IPv6, IpConfig, Nic, Vlan
from vdsm.config import config
-from vdsm import constants
-from vdsm import utils
-from storage.misc import execCmd
-import neterrors as ne
-from neterrors import ConfigNetworkError
-from vdsm import netinfo
-from netconf.ifcfg import ConfigWriter
-from netconf.ifcfg import Ifcfg
-from netmodels import Bond
-from netmodels import Bridge
-from netmodels import IPv4
-from netmodels import IPv6
-from netmodels import IpConfig
-from netmodels import Nic
-from netmodels import Vlan
-import hooks
+from vdsm import constants, netinfo, utils
+from vdsm.utils import execCmd
CONNECTIVITY_TIMEOUT_DEFAULT = 4
diff --git a/vdsm/netconf/__init__.py b/vdsm/netconf/__init__.py
index 627c84a..42aa061 100644
--- a/vdsm/netconf/__init__.py
+++ b/vdsm/netconf/__init__.py
@@ -16,14 +16,14 @@
#
# Refer to the README and COPYING files for full details of the license
#
+from __future__ import absolute_import
import logging
-from netmodels import Bond, Bridge
-from sourceRoute import DynamicSourceRoute
-from sourceRoute import StaticSourceRoute
-from vdsm import netinfo
+from ..netmodels import Bond, Bridge
+from ..sourceRoute import DynamicSourceRoute, StaticSourceRoute
from vdsm.config import config
+from vdsm import netinfo
from vdsm.netconfpersistence import RunningConfig
diff --git a/vdsm/netconf/ifcfg.py b/vdsm/netconf/ifcfg.py
index b2dcda8..3e4427a 100644
--- a/vdsm/netconf/ifcfg.py
+++ b/vdsm/netconf/ifcfg.py
@@ -16,6 +16,7 @@
#
# Refer to the README and COPYING files for full details of the license
#
+from __future__ import absolute_import
import glob
import libvirt
@@ -28,18 +29,15 @@
import shutil
import threading
-from netconf import Configurator
-from neterrors import ConfigNetworkError
-from netmodels import Nic, Bridge, IpConfig
-from sourceRoute import DynamicSourceRoute
+from . import Configurator, libvirtCfg
+from .. import dsaversion
+from .. import neterrors as ne
+from ..neterrors import ConfigNetworkError
+from ..netmodels import Bridge, IpConfig, Nic
+from ..sourceRoute import DynamicSourceRoute
from vdsm.config import config
-from vdsm import constants
-from vdsm import netinfo
-from vdsm import utils
+from vdsm import constants, netinfo, utils
from vdsm.netconfpersistence import RunningConfig
-import dsaversion
-import libvirtCfg
-import neterrors as ne
class Ifcfg(Configurator):
diff --git a/vdsm/netconf/iproute2.py b/vdsm/netconf/iproute2.py
index b198ede..67bf85d 100644
--- a/vdsm/netconf/iproute2.py
+++ b/vdsm/netconf/iproute2.py
@@ -18,10 +18,7 @@
#
-from vdsm.ipwrapper import routeAdd
-from vdsm.ipwrapper import routeDel
-from vdsm.ipwrapper import ruleAdd
-from vdsm.ipwrapper import ruleDel
+from vdsm.ipwrapper import routeAdd, routeDel, ruleAdd, ruleDel
class Iproute2(object):
diff --git a/vdsm/netconf/libvirtCfg.py b/vdsm/netconf/libvirtCfg.py
index b81231d..0dcfeac 100644
--- a/vdsm/netconf/libvirtCfg.py
+++ b/vdsm/netconf/libvirtCfg.py
@@ -20,8 +20,7 @@
from xml.dom.minidom import Document
from xml.sax.saxutils import escape
-from vdsm import libvirtconnection
-from vdsm import netinfo
+from vdsm import libvirtconnection, netinfo
def flush():
diff --git a/vdsm/netmodels.py b/vdsm/netmodels.py
index e6feeb5..f673fb4 100644
--- a/vdsm/netmodels.py
+++ b/vdsm/netmodels.py
@@ -16,6 +16,8 @@
#
# Refer to the README and COPYING files for full details of the license
#
+from __future__ import absolute_import
+
from collections import namedtuple
from contextlib import contextmanager
import logging
@@ -24,9 +26,9 @@
import socket
import struct
-from neterrors import ConfigNetworkError
+from . import neterrors as ne
+from .neterrors import ConfigNetworkError
from vdsm import netinfo
-import neterrors as ne
class NetDevice(object):
diff --git a/vdsm/sourceRoute.py b/vdsm/sourceRoute.py
index 72519d9..e43a77c 100644
--- a/vdsm/sourceRoute.py
+++ b/vdsm/sourceRoute.py
@@ -16,20 +16,16 @@
#
# Refer to the README and COPYING files for full details of the license
#
+from glob import iglob
+import logging
import os
-from glob import iglob
from libvirt import libvirtError
-import logging
import netaddr
-from vdsm import netinfo
from vdsm.constants import P_VDSM_RUN
-from vdsm.ipwrapper import IPRoute2Error
-from vdsm.ipwrapper import Route
-from vdsm.ipwrapper import routeShowTable
-from vdsm.ipwrapper import Rule
-from vdsm.ipwrapper import ruleList
+from vdsm import netinfo
+from vdsm.ipwrapper import IPRoute2Error, Route, routeShowTable, Rule, ruleList
from vdsm.utils import rmFile
diff --git a/vdsm/sourceRouteThread.py b/vdsm/sourceRouteThread.py
index 6106a3f..014ed39 100644
--- a/vdsm/sourceRouteThread.py
+++ b/vdsm/sourceRouteThread.py
@@ -1,10 +1,30 @@
+# Copyright 2013 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
+#
+from __future__ import absolute_import
+
import logging
import os
import pyinotify
-from netconf.iproute2 import Iproute2
-from sourceRoute import DynamicSourceRoute
+from .netconf.iproute2 import Iproute2
+from .sourceRoute import DynamicSourceRoute
from vdsm.constants import P_VDSM_RUN
diff --git a/vdsm/tc.py b/vdsm/tc.py
index 57c8333..2b2dfa5 100644
--- a/vdsm/tc.py
+++ b/vdsm/tc.py
@@ -26,8 +26,8 @@
import ethtool
-import storage.misc
from vdsm.constants import EXT_TC
+from vdsm.utils import execCmd
ERR_DEV_NOEXIST = 2
@@ -99,7 +99,7 @@
def _process_request(command):
- retcode, out, err = storage.misc.execCmd(command, raw=True, sudo=False)
+ retcode, out, err = execCmd(command, raw=True, sudo=False)
if retcode != 0:
raise TrafficControlException(retcode, err, command)
return out
diff --git a/vdsm/vdsm-restore-net-config b/vdsm/vdsm-restore-net-config
index 29b2a8d..6cdf84e 100755
--- a/vdsm/vdsm-restore-net-config
+++ b/vdsm/vdsm-restore-net-config
@@ -1,6 +1,6 @@
#! /usr/bin/python
#
-# Copyright 2011-2012 Red Hat, Inc.
+# Copyright 2011-2013 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
@@ -18,14 +18,15 @@
#
# Refer to the README and COPYING files for full details of the license
#
+from __future__ import absolute_import
import logging
import logging.config
-from netconf import ifcfg
+from .configNetwork import setupNetworks
+from .netconf import ifcfg
from vdsm.config import config
from vdsm.netconfpersistence import RunningConfig, PersistentConfig
-from configNetwork import setupNetworks
def ifcfg_restoration():
--
To view, visit http://gerrit.ovirt.org/20555
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I249cfa0ad734ea45ecbbecbade9daeed6c3adc12
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Reconfigure related services after vdsm rpm upgrade
......................................................................
Reconfigure related services after vdsm rpm upgrade
When performing an upgrade we might require reconfiguration of related
services. This patch force reconfigure of all related services and
restart them afterwards. After reconfigure is done, we're safe to start
vdsmd as usual.
Change-Id: I4a8c9c548b7a23588107b17351ab7f9ba3ae1d2b
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/49/20149/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index cf3dbc7..8384057 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -729,8 +729,10 @@
%postun
%if 0%{?rhel}
if [ "$1" -ge 1 ]; then
- /sbin/service vdsmd condrestart > /dev/null 2>&1
- /sbin/service supervdsmd condrestart > /dev/null 2>&1
+ if /sbin/service vdsmd condrestart > /dev/null 2>&1; then
+ %{_bindir}/vdsm-tool configure-all --force
+ /sbin/service vdsmd start > /dev/null 2>/dev/null
+ fi
fi
exit 0
%else
--
To view, visit http://gerrit.ovirt.org/20149
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a8c9c548b7a23588107b17351ab7f9ba3ae1d2b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>