Dima Kuznetsov has uploaded a new change for review.
Change subject: signals: Better handle signals to non-main threads
......................................................................
signals: Better handle signals to non-main threads
There is an issue with using signal.pause() and threads in python. The signal
might arrive to a non-main thread, and not get processed (because only the
main thread handles signals) until the main thread receives its own signal.
The issue is documented and tracked here:
https://bugzilla.redhat.com/show_bug.cgi?id=1114434
Change-Id: I5dbcd00cec22ef12f2b6253b016dcbd0aa889583
Signed-off-by: Dima Kuznetsov <dkuznets(a)redhat.com>
---
M lib/vdsm/utils.py
M vdsm/supervdsmServer
M vdsm/vdsm
3 files changed, 54 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/29392/1
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index 2ba5762..35c8387 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -1141,3 +1141,55 @@
def prependDefer(self, func, *args, **kwargs):
self._finally.insert(0, (func, args, kwargs))
+
+
+_signalPoller = None
+
+
+def _getSignalPoller():
+ '''
+ This function creates a select.poll object that can be used in the same
+ manner as signal.pause(). The poll object returns each time a signal was
+ received by the process.
+
+ This function has to be called from the main thread.
+ '''
+ if _signalPoller is None:
+ (fd_r, fd_w) = os.pipe()
+
+ # The write end is going to be written to from a c-level signal
+ # handler, so it is a good idea to make sure it does not block.
+ flags = fcntl.fcntl(fd_w, fcntl.F_GETFL, 0)
+ flags |= os.O_NONBLOCK
+ fcntl.fcntl(fd_w, fcntl.F_SETFL, flags)
+
+ # This call must be done from the main thread.
+ signal.set_wakeup_fd(fd_w)
+
+ poller = select.poll()
+ poller.register(fd_r, select.POLLIN)
+
+ global _signalPoller
+ _signalPoller = poller
+
+ return _signalPoller
+
+
+def waitForSignal():
+ '''
+ This function acts like signal.pause(), it returns after a signal was
+ received and handled. Unlike signal.pause(), it will wake up even if other
+ thread caught the signal while this function was called.
+ '''
+ poller = _getSignalPoller()
+ try:
+ events = poller.poll()
+ for (fd, flags) in events:
+ if flags & select.POLLIN:
+ os.read(fd, 1)
+ except select.error as e:
+ # Signal was received in this thread while poll() was active
+ if (e.args[0] == errno.EINTR):
+ return
+ logging.error('Received error while waiting for signal',
+ exc_info=True)
diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
index a63caa2..0b0a13f 100755
--- a/vdsm/supervdsmServer
+++ b/vdsm/supervdsmServer
@@ -446,7 +446,7 @@
sourceroutethread.start()
while _running:
- signal.pause()
+ utils.waitForSignal()
log.debug("Terminated normally")
finally:
diff --git a/vdsm/vdsm b/vdsm/vdsm
index cbc16ff..9752320 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -83,7 +83,7 @@
cif.start()
try:
while running[0]:
- signal.pause()
+ utils.waitForSignal()
profile.stop()
finally:
--
To view, visit http://gerrit.ovirt.org/29392
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5dbcd00cec22ef12f2b6253b016dcbd0aa889583
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dima Kuznetsov <dkuznets(a)redhat.com>
Yeela Kaplan has uploaded a new change for review.
Change subject: Revert 'Create default multipath.conf during install'
......................................................................
Revert 'Create default multipath.conf during install'
Revert http://gerrit.ovirt.org/#/c/30704
as the original problem of nonexistent multipath
configuration on vdsm start is resolved by:
http://gerrit.ovirt.org/#/c/30909
which configurates multipath before vdsm starts
using the vdsm configuration tool.
Change-Id: If2da0442bbcc5e33123c47d0a9f1e825fe47d1cf
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 0 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/78/30978/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index d3c8a9f..05f9485 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -745,14 +745,6 @@
/sbin/chkconfig --add supervdsmd
fi
%else
-# multipath.conf does not exists after multipath install, causing multipathd to
-# exit silently when started as vdsmd required service. This creates default
-# configuration blacklisting all devices, simulating the behavior of multipathd
-# on EL6 when configuration file is missing.
-# See https://bugzilla.redhat.com/1120209
-if [ ! -f "/etc/multipath.conf" ]; then
- /usr/sbin/mpathconf --disable
-fi
/bin/systemctl restart systemd-modules-load.service >/dev/null 2>&1 || :
if [ "$1" -eq 1 ] ; then
/bin/systemctl enable vdsmd.service >/dev/null 2>&1 || :
--
To view, visit http://gerrit.ovirt.org/30978
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If2da0442bbcc5e33123c47d0a9f1e825fe47d1cf
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
mooli tayer has uploaded a new change for review.
Change subject: tool: use natural numbers for configuration versioning.
......................................................................
tool: use natural numbers for configuration versioning.
Currently we use a vdsm version but only bump it when the
configuration actually changed.(so in 4.15 this was 4.13)
This can be misleading, and several bugs where opened
due to this issue[1].
I'm suggesting to use natural numbers and counting on the fact
that configuration should be bumped for next version[2].
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1133955
There was another bug on this that I cannot locate.
[2] Ifa8f02f0e6e1793007a8b3be49fe8a2f74076b19
Change-Id: I8f50e30fe03acb101aed4b1a7aece196a77b4c6b
Signed-off-by: Mooli Tayer <mtayer(a)redhat.com>
---
M lib/vdsm/tool/configurators/libvirt.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/32708/1
diff --git a/lib/vdsm/tool/configurators/libvirt.py b/lib/vdsm/tool/configurators/libvirt.py
index dde199c..24726bb 100644
--- a/lib/vdsm/tool/configurators/libvirt.py
+++ b/lib/vdsm/tool/configurators/libvirt.py
@@ -302,7 +302,7 @@
# version != PACKAGE_VERSION since we do not want to update configuration
# on every update. see 'configuration versioning:' at Configfile.py for
# details.
- CONF_VERSION = '4.17.0'
+ CONF_VERSION = '1'
PKI_DIR = os.path.join(constants.SYSCONF_PATH, 'pki/vdsm')
LS_CERT_DIR = os.path.join(PKI_DIR, 'libvirt-spice')
--
To view, visit http://gerrit.ovirt.org/32708
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f50e30fe03acb101aed4b1a7aece196a77b4c6b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer(a)redhat.com>
Martin Polednik has uploaded a new change for review.
Change subject: vdsm: add hostdev rules for vfio
......................................................................
vdsm: add hostdev rules for vfio
qemu requires readable /dev/vfio/[0-9][0-9]* in order to
allow attaching of host devices without root permissions.
As it's not feasible to run qemu under root, these udev rules
modify the ownership and mode to root:qemu 660 allowing to
function without changing qemu user.
Change-Id: Iba7dc8b786e1dd7399411639fa3fe35372708333
Signed-off-by: Martin Polednik <mpolednik(a)redhat.com>
---
M debian/rules
M debian/vdsm.install
M vdsm.spec.in
A vdsm/vdsm-vfio.rules.in
4 files changed, 34 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/18/32218/1
diff --git a/debian/rules b/debian/rules
index b32b160..40598cd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -40,6 +40,8 @@
# Install the lvm rules
install -Dm 0644 vdsm/storage/vdsm-lvm.rules \
$(destdir)/lib/udev/rules.d/61-vdsm-lvm.rules
+ install -Dm 0644 vdsm/vdsm-vfio.rules \
+ $(destdir)/lib/udev/rules.d/62-vdsm-vfio.rules
install -Dm 0644 vdsm/limits.conf \
$(destdir)/etc/security/limits.d/99-vdsm.conf
install -Dm 0644 init/upstart/vdsmd.upstart \
diff --git a/debian/vdsm.install b/debian/vdsm.install
index b1840ec..7eef434 100644
--- a/debian/vdsm.install
+++ b/debian/vdsm.install
@@ -21,6 +21,7 @@
./etc/vdsm/svdsm.logger.conf
./etc/vdsm/vdsm-tmpfiles.conf
./lib/udev/rules.d/61-vdsm-lvm.rules
+./lib/udev/rules.d/62-vdsm-vfio.rules
./usr/lib/python2.7/dist-packages/sos/plugins/vdsm.py
./usr/lib/python2.7/dist-packages/vdsmapi.py
./usr/libexec/vdsm/curl-img-wrap
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 323b586..9209302 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -657,6 +657,10 @@
install -Dm 0644 vdsm/storage/vdsm-lvm.rules \
%{buildroot}%{_udevrulesdir}/12-vdsm-lvm.rules
+# Install the vfio rules
+install -Dm 0644 vdsm/vdsm-vfio.rules \
+ %{buildroot}%{_udevrulesdir}/13-vdsm-vfio.rules
+
install -Dm 0644 vdsm/limits.conf \
%{buildroot}/etc/security/limits.d/99-vdsm.conf
@@ -1133,6 +1137,7 @@
%endif
%{python_sitelib}/sos/plugins/vdsm.py*
%{_udevrulesdir}/12-vdsm-lvm.rules
+%{_udevrulesdir}/13-vdsm-vfio.rules
/etc/security/limits.d/99-vdsm.conf
%{_mandir}/man8/vdsmd.8*
%if 0%{?rhel}
diff --git a/vdsm/vdsm-vfio.rules.in b/vdsm/vdsm-vfio.rules.in
new file mode 100644
index 0000000..b367235
--- /dev/null
+++ b/vdsm/vdsm-vfio.rules.in
@@ -0,0 +1,26 @@
+#
+# 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
+#
+
+# Udev rules for vfio devices.
+#
+# These rules change ownership and permissions
+# of vfio devices spawned in /dev/vfio.
+
+KERNEL=="[0-9][0-9]*", SUBSYSTEM=="vfio" GROUP:="@QEMUGROUP@" MODE="0660"
--
To view, visit http://gerrit.ovirt.org/32218
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba7dc8b786e1dd7399411639fa3fe35372708333
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
Nir Soffer has uploaded a new change for review.
Change subject: fileSD: Move private constant near the only call site
......................................................................
fileSD: Move private constant near the only call site
Keeping a private constant used by only one function at the top of the
module does not help anyone. The best place for it is just above the
code using it.
Change-Id: If8430a05dd454c34217bb051345633aec4351738
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/storage/fileSD.py
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/24/32724/1
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index 8c2c550..9a22b66 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -57,8 +57,6 @@
# Specific stat(2) block size as defined in the man page
ST_BYTES_PER_BLOCK = 512
-_MOUNTLIST_IGNORE = ('/' + sd.BLOCKSD_DIR, '/' + sd.GLUSTERSD_DIR)
-
getProcPool = oop.getGlobalProcPool
@@ -641,6 +639,9 @@
self.oop.utils.forceLink(tVol, tLink)
+_MOUNTLIST_IGNORE = ('/' + sd.BLOCKSD_DIR, '/' + sd.GLUSTERSD_DIR)
+
+
def _getMountsList(pattern="*"):
fileDomPattern = os.path.join(
sd.StorageDomain.storage_repository, sd.DOMAIN_MNT_POINT,
--
To view, visit http://gerrit.ovirt.org/32724
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If8430a05dd454c34217bb051345633aec4351738
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: Conflict with firewalld and NetworkManager and use iptables
......................................................................
Conflict with firewalld and NetworkManager and use iptables
As shown in the bug, we do have a few issues with firewalld and we
do not really integrate with it. If we configure firewalling we do
it with iptables (hence why I put it as Wants).
As for NetworkManager, it is so that if the users use other
configurators other than ifcfg (i.e. iproute2) that NM will not
take control of the device.
Change-Id: Id4bc190f4b80a5c8600de4760f69886824622670
Bug-Url: https://bugzilla.redhat.com/1144084
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M init/systemd/vdsmd.service.in
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/33171/1
diff --git a/init/systemd/vdsmd.service.in b/init/systemd/vdsmd.service.in
index 67f0dad..a786682 100644
--- a/init/systemd/vdsmd.service.in
+++ b/init/systemd/vdsmd.service.in
@@ -1,8 +1,10 @@
[Unit]
Description=Virtual Desktop Server Manager
+Wants=iptables.service
Requires=multipathd.service libvirtd.service time-sync.target \
iscsid.service rpcbind.service supervdsmd.service sanlock.service
-Conflicts=libvirt-guests.service ksmtuned.service
+Conflicts=libvirt-guests.service ksmtuned.service NetworkManager.service \
+ firewalld.service
[Service]
Type=simple
--
To view, visit http://gerrit.ovirt.org/33171
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4bc190f4b80a5c8600de4760f69886824622670
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: vdsm-tool: add the cmd get-engine-web-ca-issuer
......................................................................
vdsm-tool: add the cmd get-engine-web-ca-issuer
If oVirt Node is registered via oVirt Engine currently
we don't show to users which engine the node is registered.
This patch extracts the issuer field from engine web ca to use
the CN (commonname) data in ovirt-node-plugin-vdsm.
Change-Id: I70a19f54169498c53cabba0ac75e7a5611762ece
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1039267
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M lib/vdsm/tool/validate_ovirt_certs.py.in
1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/27651/1
diff --git a/lib/vdsm/tool/validate_ovirt_certs.py.in b/lib/vdsm/tool/validate_ovirt_certs.py.in
index 6a8c13f..149dc30 100644
--- a/lib/vdsm/tool/validate_ovirt_certs.py.in
+++ b/lib/vdsm/tool/validate_ovirt_certs.py.in
@@ -35,6 +35,7 @@
PATH_CERT = '/etc/pki/vdsm/certs/'
PATH_CACERT = PATH_CERT + 'cacert.pem'
PATH_VDSMCERT = PATH_CERT + 'vdsmcert.pem'
+PATH_ENGINE_WEB_CA = PATH_CERT + 'engine_web_ca.pem'
def is_our_cafile(cacert):
@@ -60,3 +61,17 @@
os.chown(PATH_CACERT, uid, gid)
ovirtfunctions.ovirt_store_config(PATH_CACERT)
break
+
+
+@expose('get-engine-web-ca-issuer')
+def get_engine_web_ca_issuer():
+ """
+ Extract from engine web ca certificate the issuer field
+ """
+ if os.path.exists(PATH_ENGINE_WEB_CA):
+ cmd = [
+ EX_OPENSSL, 'x509', '-in', PATH_ENGINE_WEB_CA, '-noout', '-issuer'
+ ]
+ rc, out, err = execCmd(cmd, raw=True)
+ if not err:
+ print(out),
--
To view, visit http://gerrit.ovirt.org/27651
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I70a19f54169498c53cabba0ac75e7a5611762ece
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>