Change in vdsm[master]: irs: Directly register domain state change callbacks
by alitke@redhat.com
Adam Litke has uploaded a new change for review.
Change subject: irs: Directly register domain state change callbacks
......................................................................
irs: Directly register domain state change callbacks
Currently, domain state change callbacks aren't actually registered
until a storage pool is connected. In a hosted engine environment there
is not a traditional storage pool associated with the storage domain
that is hosting the engine VM so in this case the event doesn't get
registered. Since storage pools are becoming deprecated, there is no
reason to delay callback registration based on connectStoragePool.
Change-Id: I28d4f1af4f94da1a8e3511abbe160ea66e81daad
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1157421
Signed-off-by: Adam Litke <alitke(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 2 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/69/35369/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 1164d99..045ed39 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -403,10 +403,9 @@
@public
def registerDomainStateChangeCallback(self, callbackFunc):
"""
- Currently this method assumes that all registrations
- are done *prior* to connecting to pool.
+ Register a state change callback function with the domain monitor.
"""
- self.domainStateChangeCallbacks.add(callbackFunc)
+ self.domainMonitor.onDomainStateChange.register(callbackFunc)
def _hsmSchedule(self, name, func, *args):
self.taskMng.scheduleJob("hsm", None, vars.task, name, func, *args)
@@ -1076,12 +1075,6 @@
else:
pool.setBackend(
StoragePoolMemoryBackend(pool, masterVersion, domainsMap))
-
- # Must register domain state change callbacks *before* connecting
- # the pool, which starts domain monitor threads. Otherwise we will
- # miss the first event from the monitor thread.
- for cb in self.domainStateChangeCallbacks:
- pool.domainMonitor.onDomainStateChange.register(cb)
res = pool.connect(hostID, msdUUID, masterVersion)
if res:
--
To view, visit http://gerrit.ovirt.org/35369
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I28d4f1af4f94da1a8e3511abbe160ea66e81daad
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: clientIF: Use a weakref.proxy when registering contEIOVMs
by alitke@redhat.com
Adam Litke has uploaded a new change for review.
Change subject: clientIF: Use a weakref.proxy when registering contEIOVMs
......................................................................
clientIF: Use a weakref.proxy when registering contEIOVMs
Our storage Event class is taking a weakref on the callback function
that is passed into Event.register. Unfortunately weakrefs on bound
methods are dead on arrival. See this [1] discussion for more
information. Use the same approach as StoragePool._upgradeCallback and
use a weakref.proxy to build the callback function.
[1] http://code.activestate.com/recipes/81253/
Change-Id: Ib06967b26fc9ace41e5f8305a8fadafbbb0fc4e4
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1157421
Signed-off-by: Adam Litke <alitke(a)redhat.com>
---
M vdsm/clientIF.py
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/36/35436/1
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 79ba8f8..b339211 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -23,6 +23,8 @@
import time
import threading
import uuid
+from functools import partial
+from weakref import proxy
import alignmentScan
from vdsm.config import config
@@ -76,7 +78,8 @@
self._shutdownSemaphore = threading.Semaphore()
self.irs = irs
if self.irs:
- self.irs.registerDomainStateChangeCallback(self.contEIOVms)
+ cb = partial(clientIF.contEIOVms, proxy(self))
+ self.irs.registerDomainStateChangeCallback(cb)
self.log = log
self._recovery = True
self.channelListener = Listener(self.log)
--
To view, visit http://gerrit.ovirt.org/35436
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib06967b26fc9ace41e5f8305a8fadafbbb0fc4e4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: multipath: use a backup file instead of rotateFiles
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: multipath: use a backup file instead of rotateFiles
......................................................................
multipath: use a backup file instead of rotateFiles
as part of the move to using vdsm tool configurator for multipath,
we want to consolidate the configuration of multipath with
other configurators, such as libvirt.
Rotating the configuration file will end up deleting the
most important multipath conf file for the user,
which is the original conf file - pre vdsm installation.
That is why we will only back up the original multipath conf,
and any other new changes to multipath that are important to the
user and have been made after vdsm installation should be saved
by the user.
Change-Id: I96a9251ebc852fcdf39239ba50f43dd2343b83a6
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M vdsm/storage/multipath.py
1 file changed, 28 insertions(+), 12 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/77/34077/1
diff --git a/vdsm/storage/multipath.py b/vdsm/storage/multipath.py
index 43b06f1..e5964de 100644
--- a/vdsm/storage/multipath.py
+++ b/vdsm/storage/multipath.py
@@ -28,6 +28,7 @@
import tempfile
import logging
import re
+import shutil
from collections import namedtuple
from vdsm import constants
@@ -48,6 +49,8 @@
TOXIC_CHARS = '()*+?|^$.\\'
MPATH_CONF = "/etc/multipath.conf"
+
+CONF_BACKUP = "/etc/multipath.conf.bak"
OLD_TAGS = ["# RHAT REVISION 0.2", "# RHEV REVISION 0.3",
"# RHEV REVISION 0.4", "# RHEV REVISION 0.5",
@@ -110,6 +113,19 @@
misc.execCmd([constants.EXT_MULTIPATH], sudo=True)
+def _parseConf():
+ first = second = ''
+ svdsm = supervdsm.getProxy()
+ mpathconf = svdsm.readMultipathConf()
+ try:
+ first = mpathconf[0]
+ second = mpathconf[1]
+ except IndexError:
+ pass
+
+ return (first, second)
+
+
def isEnabled():
"""
Check the multipath daemon configuration. The configuration file
@@ -120,14 +136,7 @@
"""
if os.path.exists(MPATH_CONF):
- first = second = ''
- svdsm = supervdsm.getProxy()
- mpathconf = svdsm.readMultipathConf()
- try:
- first = mpathconf[0]
- second = mpathconf[1]
- except IndexError:
- pass
+ first, second = _parseConf()
if MPATH_CONF_PRIVATE_TAG in second:
log.info("Manual override for multipath.conf detected - "
"preserving current configuration")
@@ -158,10 +167,17 @@
supported state. The original configuration, if any, is saved
"""
if os.path.exists(MPATH_CONF):
- misc.rotateFiles(
- os.path.dirname(MPATH_CONF),
- os.path.basename(MPATH_CONF), MAX_CONF_COPIES,
- cp=True, persist=True)
+ first, second = _parseConf()
+
+ if not os.path.exists(CONF_BACKUP) and MPATH_CONF_TAG not in first:
+ try:
+ shutil.copyfile(MPATH_CONF, CONF_BACKUP)
+ except IOError:
+ raise se.MultipathSetupError()
+ else:
+ utils.persist(CONF_BACKUP)
+
+
with tempfile.NamedTemporaryFile() as f:
f.write(MPATH_CONF_TEMPLATE % {'scsi_id_path': _scsi_id.cmd})
f.flush()
--
To view, visit http://gerrit.ovirt.org/34077
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I96a9251ebc852fcdf39239ba50f43dd2343b83a6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
9 years, 5 months
Change in vdsm[ovirt-3.5]: use SASL_USERNAME instead of its upstream value
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: use SASL_USERNAME instead of its upstream value
......................................................................
use SASL_USERNAME instead of its upstream value
commit 98a2692fe reverted broken code, but it also added new code, that
the reviewer failed to notice. This patch fixes it.
Bug-Url : https://bugzilla.redhat.com/show_bug.cgi?id=1168689
Change-Id: Idf7800e26d95e5da9d64b615de420389bbc7e52f
Signed-off-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/00/35800/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 5becd4a..50b9112 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -761,7 +761,7 @@
%{_bindir}/vdsm-tool configure --module sanlock --force >/dev/null
# update the vdsm "secret" password for libvirt
if [ -f /etc/pki/vdsm/keys/libvirt_password ]; then
- @SASLPASSWD2_PATH@ -p -a libvirt vdsm@ovirt < \
+ @SASLPASSWD2_PATH@ -p -a libvirt @SASL_USERNAME@ < \
/etc/pki/vdsm/keys/libvirt_password
fi
--
To view, visit http://gerrit.ovirt.org/35800
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf7800e26d95e5da9d64b615de420389bbc7e52f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: constants: remove unuesd service constant
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: constants: remove unuesd service constant
......................................................................
constants: remove unuesd service constant
Use have been moved to service.py
Change-Id: Ib8b1d0d45fa43a106db0a7fc3189503d4ee12890
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M lib/vdsm/constants.py.in
1 file changed, 0 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/79/35779/1
diff --git a/lib/vdsm/constants.py.in b/lib/vdsm/constants.py.in
index 1f710a8..f5c87ce 100644
--- a/lib/vdsm/constants.py.in
+++ b/lib/vdsm/constants.py.in
@@ -142,7 +142,6 @@
EXT_SASLPASSWD2 = '@SASLPASSWD2_PATH@'
-EXT_SERVICE = '@SERVICE_PATH@'
EXT_SETSID = '@SETSID_PATH@'
EXT_SH = '/bin/sh' # The shell path is invariable
EXT_SU = '@SU_PATH@'
--
To view, visit http://gerrit.ovirt.org/35779
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib8b1d0d45fa43a106db0a7fc3189503d4ee12890
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: remove updating libvirt_nets, it ahs no effect
by ibarkan@redhat.com
Ido Barkan has uploaded a new change for review.
Change subject: remove updating libvirt_nets, it ahs no effect
......................................................................
remove updating libvirt_nets, it ahs no effect
Change-Id: I5e4999b33419353627f7a127cbe61e8ebcb04148
Signed-off-by: ibarkan <ibarkan(a)redhat.com>
---
M vdsm/network/api.py
1 file changed, 0 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/35694/1
diff --git a/vdsm/network/api.py b/vdsm/network/api.py
index b5aec19..c5f55d8 100755
--- a/vdsm/network/api.py
+++ b/vdsm/network/api.py
@@ -731,8 +731,6 @@
logger.debug("Removing network %r", network)
delNetwork(network, configurator=configurator, force=force,
implicitBonding=False, _netinfo=_netinfo)
- if 'remove' in attrs:
- del libvirt_nets[network]
_netinfo.updateDevices()
del _netinfo.networks[network]
elif network in libvirt_nets:
@@ -742,8 +740,6 @@
logger.debug('Removing broken network %r', network)
_delBrokenNetwork(network, libvirt_nets[network],
configurator=configurator)
- if 'remove' in attrs:
- del libvirt_nets[network]
_netinfo.updateDevices()
elif 'remove' in attrs:
raise ConfigNetworkError(ne.ERR_BAD_BRIDGE, "Cannot delete "
--
To view, visit http://gerrit.ovirt.org/35694
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e4999b33419353627f7a127cbe61e8ebcb04148
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: vdsm: add functionality to release host devices
by Martin Polednik
Martin Polednik has uploaded a new change for review.
Change subject: vdsm: add functionality to release host devices
......................................................................
vdsm: add functionality to release host devices
Release call (libvirt's reAttach call) is mandatory to properly
reattach device back to host.
Change-Id: I77000c76ece87bf7335045429eab207a89badae9
Signed-off-by: Martin Polednik <mpolednik(a)redhat.com>
---
M vdsm/hostdev.py
1 file changed, 11 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/91/32391/1
diff --git a/vdsm/hostdev.py b/vdsm/hostdev.py
index 7ad5695..ef28d4e 100644
--- a/vdsm/hostdev.py
+++ b/vdsm/hostdev.py
@@ -24,6 +24,9 @@
from vdsm import libvirtconnection
+DETACHABLE_DEVICES = ('usb', 'pci')
+
+
def _parse_device_params(device_xml):
params = {}
@@ -116,3 +119,11 @@
del(devices[device_name])
return devices
+
+
+def release(device_name):
+ device = libvirtconnection.get().nodeDeviceLookupByName(device_name)
+ device_params = _parse_device_params(device)
+
+ if device_params['capability'] in DETACHABLE_DEVICES:
+ device.reAttach()
--
To view, visit http://gerrit.ovirt.org/32391
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I77000c76ece87bf7335045429eab207a89badae9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: vdsm: add functionality to acquire host devices
by Martin Polednik
Martin Polednik has uploaded a new change for review.
Change subject: vdsm: add functionality to acquire host devices
......................................................................
vdsm: add functionality to acquire host devices
Acquire call (libvirt's dettach call) is mandatory to properly
detach device from host.
Change-Id: I530fed56831314286942b8afa62900208812bfb5
Signed-off-by: Martin Polednik <mpolednik(a)redhat.com>
---
M vdsm/hostdev.py
1 file changed, 13 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/32389/1
diff --git a/vdsm/hostdev.py b/vdsm/hostdev.py
index 7ad5695..896fe95 100644
--- a/vdsm/hostdev.py
+++ b/vdsm/hostdev.py
@@ -24,6 +24,9 @@
from vdsm import libvirtconnection
+DETACHABLE_DEVICES = ('usb', 'pci')
+
+
def _parse_device_params(device_xml):
params = {}
@@ -116,3 +119,13 @@
del(devices[device_name])
return devices
+
+
+def acquire(device_name):
+ device = libvirtconnection.get().nodeDeviceLookupByName(device_name)
+ device_params = _parse_device_params(device)
+
+ if device_params['capability'] in DETACHABLE_DEVICES:
+ device.dettach()
+
+ return device_params
--
To view, visit http://gerrit.ovirt.org/32389
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I530fed56831314286942b8afa62900208812bfb5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: factor out hook logic in setupNetworks
by ibarkan@redhat.com
Ido Barkan has uploaded a new change for review.
Change subject: factor out hook logic in setupNetworks
......................................................................
factor out hook logic in setupNetworks
Change-Id: Iad0808bc2fc6260636390af925ca754ed6c51de1
Signed-off-by: ibarkan <ibarkan(a)redhat.com>
---
M vdsm/network/api.py
1 file changed, 12 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/93/35693/1
diff --git a/vdsm/network/api.py b/vdsm/network/api.py
index 8f36b31..b5aec19 100755
--- a/vdsm/network/api.py
+++ b/vdsm/network/api.py
@@ -649,6 +649,17 @@
'connectivity check failed')
+def _apply_hook(bondings, networks, options):
+ results = hooks.before_network_setup(_buildSetupHookDict(networks,
+ bondings,
+ options))
+ # gather any changes that could have been done by the hook scripts
+ networks = results['request']['networks']
+ bondings = results['request']['bondings']
+ options = results['request']['options']
+ return bondings, networks, options
+
+
def setupNetworks(networks, bondings, **options):
"""Add/Edit/Remove configuration for networks and bondings.
@@ -701,14 +712,7 @@
logging.debug("Validating configuration")
_validateNetworkSetup(networks, bondings)
- results = hooks.before_network_setup(_buildSetupHookDict(networks,
- bondings,
- options))
-
- # gather any changes that could have been done by the hook scripts
- networks = results['request']['networks']
- bondings = results['request']['bondings']
- options = results['request']['options']
+ bondings, networks, options = _apply_hook(bondings, networks, options)
libvirt_nets = netinfo.networks()
_netinfo = netinfo.NetInfo(_netinfo=netinfo.get(
--
To view, visit http://gerrit.ovirt.org/35693
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad0808bc2fc6260636390af925ca754ed6c51de1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: removed unused parameter duplication
by ibarkan@redhat.com
Ido Barkan has uploaded a new change for review.
Change subject: removed unused parameter duplication
......................................................................
removed unused parameter duplication
Change-Id: Id25e07ef13bc5fb1a9c59794aa2c41bb77c79d7e
Signed-off-by: ibarkan <ibarkan(a)redhat.com>
---
M vdsm/network/api.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/35692/1
diff --git a/vdsm/network/api.py b/vdsm/network/api.py
index 1fa4445..8f36b31 100755
--- a/vdsm/network/api.py
+++ b/vdsm/network/api.py
@@ -699,7 +699,7 @@
force = options.get('force', False)
if not utils.tobool(force):
logging.debug("Validating configuration")
- _validateNetworkSetup(dict(networks), dict(bondings))
+ _validateNetworkSetup(networks, bondings)
results = hooks.before_network_setup(_buildSetupHookDict(networks,
bondings,
--
To view, visit http://gerrit.ovirt.org/35692
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id25e07ef13bc5fb1a9c59794aa2c41bb77c79d7e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
9 years, 5 months