Dan Kenigsberg has uploaded a new change for review.
Change subject: net: maintain legacy addNetwork/delNetwork APIs
......................................................................
net: maintain legacy addNetwork/delNetwork APIs
commits 43a6b9 and 167b02 changed the signature of addNetwork and
delNetwork respectively. This must not happen, as Engine 3.5 uses
argument names in its API.
With http://www.ovirt.org/Features/HostNetworkingApi implemented in
engine-3.6, no one is going to call Vdsm's addNetwork/delNetwork any
more. However, we must keep backward compatibility as long as engine-3.5
is supported.
Bug-Url: https://bugzilla.redhat.com/1229632
Change-Id: I2eaf2b41e3e1c88721d855af0ccc3abd6c200034
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/API.py
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/87/43187/1
diff --git a/vdsm/API.py b/vdsm/API.py
index 89f35ac..eafceb7 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -1453,13 +1453,14 @@
finally:
self._cif._networkSemaphore.release()
- def addNetwork(self, network, vlan=None, bond=None, nics=None,
+ def addNetwork(self, bridge, vlan=None, bond=None, nics=None,
options=None):
"""Add a new network to this vds.
Network topology is network--[vlan--][bond--]nics.
vlan(number) and bond are optional - pass the empty string to discard
them. """
+ network = bridge
if options is None:
options = {}
@@ -1501,9 +1502,10 @@
finally:
self._cif._networkSemaphore.release()
- def delNetwork(self, network, vlan=None, bond=None, nics=None,
+ def delNetwork(self, bridge, vlan=None, bond=None, nics=None,
options=None):
"""Delete a network from this vds."""
+ network = bridge
if options is None:
options = {}
self.translateNetOptionsToNew(options)
--
To view, visit https://gerrit.ovirt.org/43187
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2eaf2b41e3e1c88721d855af0ccc3abd6c200034
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Francesco Romani has uploaded a new change for review.
Change subject: migration: avoid stacktrace on known errors
......................................................................
migration: avoid stacktrace on known errors
In migration code, if VM.migrationCreate() fails on destination host,
we raise RuntimeError to abort the normal flow.
However, in the recovery flow, we inconditionally log the stacktrace
of the exception we catched.
This is good for troubleshooiting, but it is a little pointless in
this specific use case: we know already and precisely what failed.
This patch adds a special-purpose exception for this specific, yet
important, failure scenario, and avoids the stacktrace only when
catching this exception.
Change-Id: Ib35cf08a305018912991a47d0de645395a177e9e
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/migration.py
1 file changed, 12 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/63/43063/1
diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py
index b8e155f..7ea8753 100644
--- a/vdsm/virt/migration.py
+++ b/vdsm/virt/migration.py
@@ -52,6 +52,12 @@
VIR_MIGRATE_PARAM_GRAPHICS_URI = 'graphics_uri'
+class MigrationDestinationSetupError(RuntimeError):
+ """
+ Failed to create migration destination VM.
+ """
+
+
class SourceThread(threading.Thread):
"""
A thread that takes care of migration on the source vdsm.
@@ -295,6 +301,9 @@
if '_migrationParams' in self._vm.conf:
del self._vm.conf['_migrationParams']
SourceThread._ongoingMigrations.release()
+ except MigrationDestinationSetupError as e:
+ self._recover(str(e))
+ # we know what happened, no need to dump hollow stack trace
except Exception as e:
self._recover(str(e))
self.log.exception("Failed to migrate")
@@ -326,8 +335,9 @@
if result['status']['code']:
self.status = result
- raise RuntimeError('migration destination error: ' +
- result['status']['message'])
+ raise MigrationDestinationSetupError(
+ 'migration destination error: ' +
+ result['status']['message'])
if config.getboolean('vars', 'ssl'):
transport = 'tls'
else:
--
To view, visit https://gerrit.ovirt.org/43063
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib35cf08a305018912991a47d0de645395a177e9e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/39780
to review the following change.
Change subject: supervdsm: Add zombiereaper to supervdsm
......................................................................
supervdsm: Add zombiereaper to supervdsm
Supervdsm uses multiprocessing.Process to impersonate other users and
check access. To avoid waiting on the subprocesses, we add all
subprocesses that were not waited upon to zombiereaper.
Change-Id: I938a1f2bc70fceab2c69bc8b3d8c0724a9da7720
Bug-url: https://bugzilla.redhat.com/show_bug.cgi?id=841486
Signed-off-by: Dima Kuznetsov <dkuznets(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/28915
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
Signed-off-by: Dima Kuznetsov <dkuznets(a)redhat.com>
---
M vdsm/supervdsmServer
1 file changed, 27 insertions(+), 14 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/80/39780/1
diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
index 3cdbf71..b8b6ff7 100755
--- a/vdsm/supervdsmServer
+++ b/vdsm/supervdsmServer
@@ -32,6 +32,7 @@
import logging
import logging.config
from vdsm.infra import sigutils
+from vdsm.infra import zombiereaper
import numaUtils
@@ -236,23 +237,34 @@
proc = Process(target=child, args=(hisPipe,))
proc.start()
- if not pipe.poll(RUN_AS_TIMEOUT):
- try:
- os.kill(proc.pid, signal.SIGKILL)
- except OSError as e:
- # If it didn't fail because process is already dead
- if e.errno != errno.ESRCH:
- raise
+ needReaping = True
+ try:
+ if not pipe.poll(RUN_AS_TIMEOUT):
+ try:
- raise Timeout()
+ os.kill(proc.pid, signal.SIGKILL)
+ except OSError as e:
+ # Don't add to zombiereaper of PID no longer exists
+ if e.errno == errno.ESRCH:
+ needReaping = False
+ else:
+ raise
- res, err = pipe.recv()
- pipe.send("Bye")
- proc.terminate()
- if err is not None:
- raise err
+ raise Timeout()
- return res
+ res, err = pipe.recv()
+ pipe.send("Bye")
+ proc.terminate()
+
+ if err is not None:
+ raise err
+
+ return res
+
+ finally:
+ # Add to zombiereaper if process has not been waited upon
+ if proc.exitcode is None and needReaping:
+ zombiereaper.autoReapPID(proc.pid)
@logDecorator
def validateAccess(self, user, groups, *args, **kwargs):
@@ -465,6 +477,7 @@
if not config.getboolean('vars', 'core_dump_enable'):
resource.setrlimit(resource.RLIMIT_CORE, (0, 0))
sigutils.register()
+ zombiereaper.registerSignalHandler()
def bind(func):
def wrapper(_SuperVdsm, *args, **kwargs):
--
To view, visit https://gerrit.ovirt.org/39780
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I938a1f2bc70fceab2c69bc8b3d8c0724a9da7720
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dima Kuznetsov <dkuznets(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Dima Kuznetsov has uploaded a new change for review.
Change subject: tool: Remove upstart handling in libvirt configurator
......................................................................
tool: Remove upstart handling in libvirt configurator
libvirt configurator used to check if upstart is available and configure
libvirtd using initctl.
Since systemd is now the system manager on Debian Jessie, RHEL7 and
Ubuntu Vivid, we no longer have to support sysvinit/upstart.
Change-Id: Ic71430103cb04a5636b4b41371852cbf68495db7
Signed-off-by: Dima Kuznetsov <dkuznets(a)redhat.com>
---
M lib/vdsm/tool/configurators/libvirt.py
1 file changed, 0 insertions(+), 61 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/20/40420/1
diff --git a/lib/vdsm/tool/configurators/libvirt.py b/lib/vdsm/tool/configurators/libvirt.py
index e182231..5b14cea 100644
--- a/lib/vdsm/tool/configurators/libvirt.py
+++ b/lib/vdsm/tool/configurators/libvirt.py
@@ -17,11 +17,8 @@
# Refer to the README and COPYING files for full details of the license
#
import errno
-import filecmp
import os
import uuid
-import rpm
-import shutil
import sys
from vdsm.config import config
@@ -39,7 +36,6 @@
ConfigFile,
ParserWrapper,
)
-from .. import service
from .. validate_ovirt_certs import validate_ovirt_certs
from ... import utils
from ... import constants
@@ -58,8 +54,6 @@
def configure():
- _sysvToUpstart()
-
if utils.isOvirtNode():
if not os.path.exists(constants.P_VDSM_CERT):
raise InvalidRun(
@@ -117,61 +111,6 @@
cfile['path'] for cfile in FILES.values()
if cfile['persisted']
]
-
-
-def _sysvToUpstart():
- """
- On RHEL 6, libvirtd can be started by either SysV init or Upstart.
- We prefer upstart because it respawns libvirtd if libvirtd
- crashed.
- """
- def iterateLibvirtFiles():
- ts = rpm.TransactionSet()
- for name in ['libvirt', 'libvirt-daemon']:
- for matches in ts.dbMatch('name', name):
- for filename in matches[rpm.RPMTAG_FILENAMES]:
- yield filename
-
- def reloadConfiguration():
- rc, out, err = utils.execCmd((INITCTL,
- "reload-configuration"))
- if rc != 0:
- sys.stdout.write(out)
- sys.stderr.write(err)
- raise InvalidRun(
- "Failed to reload upstart configuration.")
-
- INITCTL = '/sbin/initctl'
- LIBVIRTD_UPSTART = 'libvirtd.upstart'
- TARGET = os.path.join(constants.SYSCONF_PATH, "init/libvirtd.conf")
-
- if os.path.isfile(INITCTL) and os.access(INITCTL, os.X_OK):
- # libvirtd package does not provide libvirtd.upstart,
- # this could happen in Ubuntu or other distro,
- # so continue to use system default init mechanism
- packaged = ''
- for fname in iterateLibvirtFiles():
- if os.path.basename(fname) == LIBVIRTD_UPSTART:
- packaged = fname
- break
-
- if os.path.isfile(packaged):
- if not os.path.isfile(TARGET):
- service.service_stop('libvirtd')
- if (not os.path.isfile(TARGET) or
- not filecmp.cmp(packaged, TARGET)):
- oldmod = None
- if os.path.isfile(TARGET):
- oldmod = os.stat(TARGET).st_mode
-
- utils.unpersist(TARGET)
- shutil.copyfile(packaged, TARGET)
- utils.persist(TARGET)
-
- if (oldmod is not None and
- oldmod != os.stat(TARGET).st_mode):
- os.chmod(TARGET, oldmod)
- reloadConfiguration()
def _isSslConflict():
--
To view, visit https://gerrit.ovirt.org/40420
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic71430103cb04a5636b4b41371852cbf68495db7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dima Kuznetsov <dkuznets(a)redhat.com>