Change in vdsm[master]: libvirtconnection: Use log as a variable
by Maor Lipchuk
Maor Lipchuk has uploaded a new change for review.
Change subject: libvirtconnection: Use log as a variable
......................................................................
libvirtconnection: Use log as a variable
Assign log variable the default logger.
Change-Id: I8f1a7fd7e2dec9bb9ab037348f0276feb746b787
Signed-off-by: Maor Lipchuk <mlipchuk(a)redhat.com>
---
M lib/vdsm/libvirtconnection.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/07/22907/1
diff --git a/lib/vdsm/libvirtconnection.py b/lib/vdsm/libvirtconnection.py
index 60fee0e..440c7c5 100644
--- a/lib/vdsm/libvirtconnection.py
+++ b/lib/vdsm/libvirtconnection.py
@@ -27,7 +27,7 @@
import libvirt
from . import constants, utils
-log = logging.getLogger("libvirtconnection")
+log = logging.getLogger()
class _EventLoop:
--
To view, visit http://gerrit.ovirt.org/22907
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f1a7fd7e2dec9bb9ab037348f0276feb746b787
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipchuk(a)redhat.com>
10 years, 4 months
Change in vdsm[master]: [3/x] Bugfix: Return lastClientIface for *current* connection
by amuller@redhat.com
Assaf Muller has uploaded a new change for review.
Change subject: [3/x] Bugfix: Return lastClientIface for *current* connection
......................................................................
[3/x] Bugfix: Return lastClientIface for *current* connection
Change-Id: I36e48cc07a27f44a2b413f0e9159110404f1b0ca
Signed-off-by: Assaf Muller <amuller(a)redhat.com>
---
M vdsm/BindingXMLRPC.py
1 file changed, 15 insertions(+), 19 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/37/22837/1
diff --git a/vdsm/BindingXMLRPC.py b/vdsm/BindingXMLRPC.py
index 1ffed25..2364684 100644
--- a/vdsm/BindingXMLRPC.py
+++ b/vdsm/BindingXMLRPC.py
@@ -80,6 +80,15 @@
self._thread.join()
return {'status': doneCode}
+ def updateTimestamp(self):
+ # FIXME: The setup+editNetwork API uses this log file to
+ # determine if this host is still accessible. We use a
+ # file (rather than an event) because setup+editNetwork is
+ # performed by a separate, root process. To clean this
+ # up we need to move this to an API wrapper that is only
+ # run for real clients (not vdsm internal API calls).
+ file(constants.P_VDSM_CLIENT_LOG, 'w')
+
def _getKeyCertFilenames(self):
"""
Get the locations of key and certificate files.
@@ -97,26 +106,13 @@
threadLocal = self.cif.threadLocal
- class LoggingMixIn:
-
- def log_request(self, code='-', size='-'):
- """Track from where client connections are coming."""
- self.server.lastClient = self.client_address[0]
- # FIXME: The editNetwork API uses this log file to
- # determine if this host is still accessible. We use a
- # file (rather than an event) because editNetwork is
- # performed by a separate, root process. To clean this
- # up we need to move this to an API wrapper that is only
- # run for real clients (not vdsm internal API calls).
- file(constants.P_VDSM_CLIENT_LOG, 'w')
-
server_address = (self.serverIP, int(self.serverPort))
if self.enableSSL:
basehandler = SecureXMLRPCServer.SecureXMLRPCRequestHandler
else:
basehandler = SimpleXMLRPCServer.SimpleXMLRPCRequestHandler
- class LoggingHandler(LoggingMixIn, basehandler):
+ class LoggingHandler(basehandler):
def setup(self):
threadLocal.client = self.client_address[0]
return basehandler.setup(self)
@@ -140,13 +136,12 @@
requestHandler=LoggingHandler, logRequests=True)
utils.closeOnExec(server.socket.fileno())
- server.lastClient = '0.0.0.0'
-
return server
def _registerFunctions(self):
def wrapIrsMethod(f):
def wrapper(*args, **kwargs):
+ self.updateTimestamp()
fmt = ""
logargs = []
@@ -298,10 +293,10 @@
def getCapabilities(self):
api = API.Global()
ret = api.getCapabilities()
- last = self.server.lastClient
ret['info']['management_ip'] = self.serverIP
- ret['info']['lastClient'] = last
- ret['info']['lastClientIface'] = getRouteDeviceTo(destinationIP=last)
+ ret['info']['lastClient'] = self.cif.threadLocal.client
+ ret['info']['lastClientIface'] = getRouteDeviceTo(
+ destinationIP=self.cif.threadLocal.client)
return ret
def getHardwareInfo(self):
@@ -943,6 +938,7 @@
def wrapApiMethod(f):
def wrapper(*args, **kwargs):
try:
+ f.im_self.updateTimestamp()
logLevel = logging.DEBUG
if f.__name__ in ('getVMList', 'getAllVmStats', 'getStats',
'fenceNode'):
--
To view, visit http://gerrit.ovirt.org/22837
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I36e48cc07a27f44a2b413f0e9159110404f1b0ca
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Assaf Muller <amuller(a)redhat.com>
10 years, 4 months
Change in vdsm[master]: [2/x] BindingXMLRPC cleanup: Remove unused variables
by amuller@redhat.com
Assaf Muller has uploaded a new change for review.
Change subject: [2/x] BindingXMLRPC cleanup: Remove unused variables
......................................................................
[2/x] BindingXMLRPC cleanup: Remove unused variables
Change-Id: I1d36a9f71b4d192b8ba825e95055dd42fc278248
Signed-off-by: Assaf Muller <amuller(a)redhat.com>
---
M vdsm/BindingXMLRPC.py
1 file changed, 0 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/36/22836/1
diff --git a/vdsm/BindingXMLRPC.py b/vdsm/BindingXMLRPC.py
index 4c78bdf..1ffed25 100644
--- a/vdsm/BindingXMLRPC.py
+++ b/vdsm/BindingXMLRPC.py
@@ -18,7 +18,6 @@
# Refer to the README and COPYING files for full details of the license
#
-import time
from errno import EINTR
import SimpleXMLRPCServer
from vdsm import SecureXMLRPCServer
@@ -103,8 +102,6 @@
def log_request(self, code='-', size='-'):
"""Track from where client connections are coming."""
self.server.lastClient = self.client_address[0]
- self.server.lastClientTime = time.time()
- self.server.lastServerIP = self.request.getsockname()[0]
# FIXME: The editNetwork API uses this log file to
# determine if this host is still accessible. We use a
# file (rather than an event) because editNetwork is
@@ -143,9 +140,7 @@
requestHandler=LoggingHandler, logRequests=True)
utils.closeOnExec(server.socket.fileno())
- server.lastClientTime = 0
server.lastClient = '0.0.0.0'
- server.lastServerIP = '0.0.0.0'
return server
--
To view, visit http://gerrit.ovirt.org/22836
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d36a9f71b4d192b8ba825e95055dd42fc278248
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Assaf Muller <amuller(a)redhat.com>
10 years, 4 months
Change in vdsm[master]: [1/x] BindingXMLRPC cleanup: Remove/inline getServerInfo
by amuller@redhat.com
Assaf Muller has uploaded a new change for review.
Change subject: [1/x] BindingXMLRPC cleanup: Remove/inline getServerInfo
......................................................................
[1/x] BindingXMLRPC cleanup: Remove/inline getServerInfo
Change-Id: I9f19630f995c2fe9fb3e3c11e4027f22f98722ba
Signed-off-by: Assaf Muller <amuller(a)redhat.com>
---
M vdsm/BindingXMLRPC.py
1 file changed, 4 insertions(+), 10 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/22835/1
diff --git a/vdsm/BindingXMLRPC.py b/vdsm/BindingXMLRPC.py
index a340ae7..4c78bdf 100644
--- a/vdsm/BindingXMLRPC.py
+++ b/vdsm/BindingXMLRPC.py
@@ -81,15 +81,6 @@
self._thread.join()
return {'status': doneCode}
- def getServerInfo(self):
- """
- Return the IP address and last client information
- """
- last = self.server.lastClient
- return {'management_ip': self.serverIP,
- 'lastClient': last,
- 'lastClientIface': getRouteDeviceTo(destinationIP=last)}
-
def _getKeyCertFilenames(self):
"""
Get the locations of key and certificate files.
@@ -312,7 +303,10 @@
def getCapabilities(self):
api = API.Global()
ret = api.getCapabilities()
- ret['info'].update(self.getServerInfo())
+ last = self.server.lastClient
+ ret['info']['management_ip'] = self.serverIP
+ ret['info']['lastClient'] = last
+ ret['info']['lastClientIface'] = getRouteDeviceTo(destinationIP=last)
return ret
def getHardwareInfo(self):
--
To view, visit http://gerrit.ovirt.org/22835
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f19630f995c2fe9fb3e3c11e4027f22f98722ba
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Assaf Muller <amuller(a)redhat.com>
10 years, 4 months
Change in vdsm[master]: vdsm: Add log to sourceRouteThread
by Maor Lipchuk
Maor Lipchuk has uploaded a new change for review.
Change subject: vdsm: Add log to sourceRouteThread
......................................................................
vdsm: Add log to sourceRouteThread
Adding a log for sourceRouteThread so the log
will also contain the module name.
Change-Id: I34c73757a0dd4523ded40e8424ed12480ca61727
Signed-off-by: Maor Lipchuk <mlipchuk(a)redhat.com>
---
M vdsm/sourceRouteThread.py
1 file changed, 4 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/22814/1
diff --git a/vdsm/sourceRouteThread.py b/vdsm/sourceRouteThread.py
index c913220..8de9d8a 100644
--- a/vdsm/sourceRouteThread.py
+++ b/vdsm/sourceRouteThread.py
@@ -13,8 +13,9 @@
class DHClientEventHandler(pyinotify.ProcessEvent):
+ log = logging.getLogger('vdsm.DHClientEventHandler')
def process_IN_CLOSE_WRITE_filePath(self, sourceRouteFilePath):
- logging.debug("Responding to DHCP response in %s" %
+ self.log.debug("Responding to DHCP response in %s" %
sourceRouteFilePath)
with open(sourceRouteFilePath, 'r') as sourceRouteFile:
sourceRouteContents = sourceRouteFile.read().split()
@@ -31,7 +32,7 @@
else:
sourceRoute.remove()
else:
- logging.info("interface %s is not a libvirt interface" %
+ self.log.info("interface %s is not a libvirt interface" %
sourceRoute.device)
DynamicSourceRoute.removeInterfaceTracking(device)
@@ -43,7 +44,7 @@
def subscribeToInotifyLoop():
- logging.debug("sourceRouteThread.subscribeToInotifyLoop started")
+ self.log.debug("sourceRouteThread.subscribeToInotifyLoop started")
# Subscribe to pyinotify event
watchManager = pyinotify.WatchManager()
--
To view, visit http://gerrit.ovirt.org/22814
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I34c73757a0dd4523ded40e8424ed12480ca61727
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipchuk(a)redhat.com>
10 years, 4 months
Change in vdsm[master]: hsm: remove master info from getStorageDomainInfo
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: hsm: remove master info from getStorageDomainInfo
......................................................................
hsm: remove master info from getStorageDomainInfo
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1033942
Change-Id: I8c046db3884b56b57cc1bf040f3e9cc136c6d877
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 1 insertion(+), 36 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/24/22824/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 6f4e3c4..99a7389 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -2712,42 +2712,7 @@
# getSharedLock(connectionsResource...)
vars.task.getSharedLock(STORAGE, sdUUID)
- info = dom.getInfo()
- # This only occurred because someone
- # thought it would be clever to return pool
- # information in the domain.getInfo() method
- # In a perfect world I would have just stopped
- # giving this information in the response.
- # This, of-course breaks backward compatibility.
- # These keys are not likely to change (also because of
- # BC) so it's not that horrible. In any case please
- # remove this when we can stop supporting this API.
- info.update({'lver': -1, 'spm_id': -1, 'master_ver': 0})
- if info['role'] == sd.MASTER_DOMAIN:
- try:
- # Verify that the host is connected to the same pool which
- # the SD is attached to.
- pool = self.getPool(info['pool'][0])
- except IndexError:
- self.log.error("Domain %s is marked as master but is not "
- "attached to any pool", sdUUID)
- except se.StoragePoolUnknown:
- current = self.pools.keys()[0].spUUID if self.pools else None
- self.log.error("Domain %s, marked as master, is attached to "
- "pool %s but this host is connected to pool %s",
- sdUUID, info['pool'], current, exc_info=True)
- else:
- # make sure it's THE master of this pool
- if pool.masterDomain.sdUUID != sdUUID:
- self.log.warn("Domain %s is marked as master but actual "
- "master is %s",
- sdUUID, pool.masterDomain.sdUUID)
- else:
- poolInfo = pool.getInfo()
- for key in ('lver', 'spm_id', 'master_ver'):
- info[key] = poolInfo[key]
-
- return dict(info=info)
+ return dict(info=dom.getInfo())
@public
def getStorageDomainStats(self, sdUUID, options=None):
--
To view, visit http://gerrit.ovirt.org/22824
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c046db3884b56b57cc1bf040f3e9cc136c6d877
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
10 years, 4 months
Change in vdsm[master]: vdsm: Add tuneBlockDevIo interface
by iheim@redhat.com
Itamar Heim has abandoned this change.
Change subject: vdsm: Add tuneBlockDevIo interface
......................................................................
Abandoned
--
To view, visit http://gerrit.ovirt.org/14394
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: abandon
Gerrit-Change-Id: Icb33510a081d221af0f69d4dd2d55adf0b79efd2
Gerrit-PatchSet: 14
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mei Liu <liumbj(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Better Saggi <bettersaggi(a)gmail.com>
Gerrit-Reviewer: Doron Fediuck <dfediuck(a)redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Itamar Heim <iheim(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Mei Liu <liumbj(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
10 years, 4 months
Change in vdsm[master]: vdsm: allow hooks to pass down dictionaries in json format
by amuller@redhat.com
Assaf Muller has posted comments on this change.
Change subject: vdsm: allow hooks to pass down dictionaries in json format
......................................................................
Patch Set 7:
A humble request: Please give enough time for the thread on arch/vdsm to die down before considering merging this patch. IE: Give us slower folks time to review post thread discussions :)
--
To view, visit http://gerrit.ovirt.org/20330
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie07c511e9740fd19a1c27baf87e91f9a427d0dcd
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Miguel Angel Ajo Pelayo <majopela(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Miguel Angel Ajo Pelayo <majopela(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
10 years, 4 months
Change in vdsm[master]: supervdsmServer: Cleaner way to wait for signals
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: supervdsmServer: Cleaner way to wait for signals
......................................................................
supervdsmServer: Cleaner way to wait for signals
supervdsmServer was using silly way to wait for termination. Uses now
standard way to do this.
Change-Id: I7f0a1fdd518df1524441fd856fc764f8dbd7cf79
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/supervdsmServer
1 file changed, 12 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/19/22719/1
diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
index b3b3bff..408dc4e 100755
--- a/vdsm/supervdsmServer
+++ b/vdsm/supervdsmServer
@@ -80,6 +80,7 @@
RUN_AS_TIMEOUT = config.getint("irs", "process_pool_timeout")
+_running = True
class Timeout(RuntimeError):
pass
@@ -361,6 +362,10 @@
return self.__udevVersion() > self.UDEV_WITH_RELOAD_VERSION
+def terminate(signo, frame):
+ global _running
+ _running = False
+
def main(sockfile, pidfile=None):
log = logging.getLogger("SuperVdsm.Server")
@@ -393,6 +398,9 @@
log.debug("Setting up keep alive thread")
try:
+ signal.signal(signal.SIGTERM, terminate)
+ signal.signal(signal.SIGINT, terminate)
+
log.debug("Creating remote object manager")
manager = _SuperVdsmManager(address=address, authkey='')
manager.register('instance', callable=_SuperVdsm)
@@ -412,10 +420,10 @@
_sourceRouteThread.daemon = True
_sourceRouteThread.start()
- # Python bug of thread.join() will block signal
- # http://bugs.python.org/issue1167930
- while servThread.isAlive():
- servThread.join(5)
+ while _running:
+ signal.pause()
+
+ log.debug("Terminated normally")
finally:
if os.path.exists(address):
utils.rmFile(address)
--
To view, visit http://gerrit.ovirt.org/22719
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f0a1fdd518df1524441fd856fc764f8dbd7cf79
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
10 years, 4 months
Change in vdsm[master]: update NIC: having no custom properies is valid
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: update NIC: having no custom properies is valid
......................................................................
update NIC: having no custom properies is valid
Older Engines, that preceded per-vNIC custom properties (Vdsm commit
38b1f8fb) do not send the "custom" element at all. This has to be
interpreted exactly as an empty custom element.
Change-Id: If510f012039304ad16000d46d9d72a3e035539f5
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/22922/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 6467e0e..2a845b0 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -3192,7 +3192,7 @@
if network == '':
network = DUMMY_BRIDGE
linkValue = 'down'
- custom = params.get('custom')
+ custom = params.get('custom', {})
specParams = params.get('specParams')
netsToMirror = params.get('portMirroring',
--
To view, visit http://gerrit.ovirt.org/22922
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If510f012039304ad16000d46d9d72a3e035539f5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
10 years, 4 months