Change in vdsm[master]: Add man page for vdsm.conf
by Douglas Schilling Landgraf
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: Add man page for vdsm.conf
......................................................................
Add man page for vdsm.conf
Show to user the vdsm.conf options.
Change-Id: Id8e5a47d484fa06070d4566a39cab8a7a53ea717
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M debian/vdsm.install
M vdsm.spec.in
M vdsm/Makefile.am
A vdsm/vdsm.conf.5
4 files changed, 400 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/91/22891/1
diff --git a/debian/vdsm.install b/debian/vdsm.install
index ef46ed3..0c2b137 100644
--- a/debian/vdsm.install
+++ b/debian/vdsm.install
@@ -31,6 +31,7 @@
./usr/libexec/vdsm/unpersist-vdsm-hook
./usr/libexec/vdsm/vdsm-gencerts.sh
./usr/libexec/vdsm/vdsmd_init_common.sh
+./usr/share/man/man5/vdsm.conf.5
./usr/share/man/man8/vdsmd.8
./usr/share/vdsm/API.py
./usr/share/vdsm/BindingJsonRpc.py
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 385a29b..364997b 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -1014,6 +1014,7 @@
%{python_sitelib}/sos/plugins/vdsm.py*
/lib/udev/rules.d/12-vdsm-lvm.rules
/etc/security/limits.d/99-vdsm.conf
+%{_mandir}/man5/vdsm.conf.5*
%{_mandir}/man8/vdsmd.8*
%if 0%{?rhel}
%dir %{_localstatedir}/log/core
diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
index 3834f55..1c1671e 100644
--- a/vdsm/Makefile.am
+++ b/vdsm/Makefile.am
@@ -89,6 +89,9 @@
vdsm-restore-net-config \
$(NULL)
+dist_man5_MANS = \
+ vdsm.conf.5
+
nodist_man8_MANS = \
vdsmd.8
diff --git a/vdsm/vdsm.conf.5 b/vdsm/vdsm.conf.5
new file mode 100644
index 0000000..98b4ccd
--- /dev/null
+++ b/vdsm/vdsm.conf.5
@@ -0,0 +1,395 @@
+.\"Copyright 2010-2013 Red Hat, Inc. and/or its affiliates.
+.\"
+.\"Licensed to you under 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. See the files README and
+.\"LICENSE_GPL_v2 which accompany this distribution.
+.\"
+.\"
+.\" File Name macro definition plagiarized from bash.
+.\"
+.de FN
+\fI\|\\$1\|\fP
+..
+.TH VDSM.CONF 5 "December 6, 2013" "" ""
+.SH NAME
+vdsm.conf \- The configuration file for Virtual Desktops and Servers Manager (VDSM)
+.br
+.SH SYNOPSIS
+.PP
+The
+vdsm\&.conf
+file is a configuration file for VDSM.
+vdsm\&.conf
+contains runtime configuration information for the VDSM\&.
+The complete description of the file format and possible parameters held within are here for reference
+purposes\&.
+.SH "FILE FORMAT"
+.PP
+The file consists of sections and parameters\&. A section begins with the name of the section in square brackets and
+continues until the next section begins\&. Sections contain parameters of the form:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+\fIname\fR = \fIvalue \fR
+.fi
+.if n \{\
+.RE
+.\}
+
+.SH CONFIGURATION BY SECTION (EXAMPLE)
+.PP
+.B [vars]
+
+\fBcore_dump_enable\fR = true
+.br
+Enable core dump
+
+\fBhost_mem_reserve\fR = 256
+.br
+Reserves memory for the host to prevent VMs from using all the physical pages. The values are in Mbytes.
+
+\fBguest_ram_overhead\fR = 65
+
+\fBextra_mem_reserve\fR = 65
+.br
+Memory reserved for non-vds-administered programs.
+
+\fBfake_nics\fR
+.br
+Comma-separated list of fnmatch-patterns for dummy hosts nics to be shown to vdsm.
+
+\fBnic_model\fR = rtl8139,pv
+.br
+NIC model is rtl8139, ne2k_pci pv or any other valid device recognized by kvm/qemu if a coma separated list
+given then a NIC per device will be created.
+
+\fBmigration_timeout\fR = 300
+.br
+Maximum time the destination waits for migration to end. Source waits twice aslong (to avoid races)
+
+\fBmigration_listener_timeout\fR = 30
+.br
+Time to wait (in seconds) for migration destination to start listening before migration begins.
+
+\fBmigration_max_bandwidth\fR = 32
+.br
+Maximum bandwidth for migration, in MiBps, 0 means libvirt's default, since 0.10.x default in libvirt is unlimited
+
+\fBmigration_monitor_intervang\fR = 10
+.br
+How often (in seconds) should the monitor thread pulse, 0 means the thread is disabled
+
+\fBhidden_nics\fR = wlan*,usb*
+.br
+Comma-separated list of fnmatch-patterns for host nics to be hidden from vdsm.
+
+\fBdefault_bridge\fR = engine
+.br
+Default bridge
+
+\fBmigration_downtime\fR = 500
+.br
+Maxmium allowed downtime for live migration in milliseconds (anything below 100ms is ignored) if you do not care about
+liveness of migration, set to a very high value, such as 600000.
+
+\fBmigration_downtime_steps\fR = 10
+.br
+Incremental steps used to reach migration_downtime
+
+\fBmax_outgoing_migrations\fR = 3
+.br
+Maximum concurrent outgoing migrations
+
+\fBsys_shutdown_timeout\fR = 10
+.br
+Destroy and shutdown timeouts (in sec) before completing the action.
+
+\fBuser_shutdown_timeout\fR = 30
+.br
+Grace period (seconds) to let guest user close his applications before shutdown.
+
+\fBguest_agent_timeout\fR = 30
+.br
+Time (in sec) to wait for guest agent.
+
+\fBvm_command_timeout\fR = 60
+.br
+Time to wait (in seconds) for vm to respond to a monitor command, 30 secs is a nice default. Set to 300 if the vm is expected to freeze during cluster failover.
+
+\fBvm_watermark_interval\fR = 2
+.br
+How often should we sample each vm for statistics (seconds).
+
+\fBvm_sample_cpu_interval\fR = 15
+.br
+Interval to collect sampe from CPU
+
+\fBvm_sample_cpu_window\fR = 2
+.br
+Interval to collect from CPU window
+
+\fBvm_sample_disk_interval\fR = 60
+.br
+Interval to collect sample from disk
+
+\fBvm_sample_disk_window\fR = 2
+.br
+Interval to collect disk window
+
+\fBvm_sample_disk_latency_interval\fR = 60
+.br
+Interval to collect disk latency
+
+\fBvm_sample_disk_latency_window\fR = 2
+.br
+Interval to collect disk latency window
+
+\fBvm_sample_net_interval\fR = 5
+.br
+Interval to collect sample from net
+
+\fBvm_sample_net_window\fR = 2
+.br
+Interval to collect sample from net window
+
+\fBtrust_store_path\fR = /etc/pki/vdsm
+.br
+Where the certificates and keys are situated
+
+\fBssl\fR = true
+.br
+Whether to use ssl encryption and authentication.
+
+\fBvds_responsiveness_timeout\fR = 60
+.br
+Responsiveness timeout
+
+\fBvdsm_nice\fR = -5
+.br
+Set vdsm scheduling priority
+
+\fBqemu_drive_cache\fR = none
+.br
+Qemu drive cache
+
+\fBfake_kvm_support\fR = false
+.br
+Emulate kvm support
+
+\fBxmlrpc_enable\fR = true
+.br
+Enable the xmlrpc server
+
+\fBjsonrpc_enable\fR = true
+.br
+Enable the JSON RPC server
+
+\fBreport_host_threads_as_cores\fR = false
+.br
+Count each cpu hyperthread as an individual core
+
+\fBlibvirt_env_variable_log_filters\fR
+.br
+Specify the log filters to track libvirt calls
+
+\fBlibvirt_env_variable_log_outputs\fR
+.br
+Specify the output to track libvirt calls
+
+.B [ksm]
+.br
+\fBksm_monitor_thread\fR = true
+.br
+KSM Monitor
+
+.br
+.B [mom]
+.br
+\fBconf\fR = /etc/vdsm/mom.conf
+.br
+Mom conf file
+.br
+
+.B [irs]
+.br
+\fBirs_enable\fR = true
+.br
+Enable IRS
+
+\fBrepository\fR = path to repository
+.br
+Image Repository
+
+\fBhsm_tasks\fR = (repository)/hsm
+.br
+hsm dir
+
+\fBimages\fR = images/
+.br
+images dir
+
+\fBirsd\fR = (images)/irsd
+.br
+irsd dir
+
+\fBimages_check_times\fR = 0
+.br
+Image repository check period (seconds).
+
+\fBvolume_utilization_percent\fR = 50
+.br
+Volume utilization percent
+
+\fBvolume_utilization_chunk_mb\fR = 1024
+.br
+Volume utilization chunk of mb
+
+\fBvol_size_sample_interval\fR = 60
+.br
+How often should the volume size be checked (seconds).
+
+\fBsd_validate_timeout\fR = 80
+.br
+Storage domain validate timeout, the maximum number of seconds to wait until all the domains will be validated.
+
+\fBscsi_rescan_minimal_timeout\fR = 2
+.br
+The minimum number of seconds to wait for scsi scan to return.
+
+\fBscsi_rescan_maximal_timeout\fR = 30
+.br
+The maximal number of seconds to wait for scsi scan to return.
+
+\fBsd_health_check_delay\fR = 10
+.br
+Storage domain health check delay, the amount of seconds to wait between two successive run of the domain health check.
+
+\fBnfs_mount_options\fR = soft,nosharecache
+.br
+NFS mount options, comma-separated list (NB: no white space allowed!)
+
+\fBpools_data_dir\fR = /var/run/vdsm/pools
+.br
+Pool data dir
+
+\fBvol_extend_policy\fR = ON
+.br
+Volume extend policy
+
+\fBlock_util_path\fR = /usr/libexec/vdsm
+.br
+Block util path
+
+\fBlock_cmd\fR = spmprotect.sh
+.br
+The lock command
+
+\fBfree_lock_cmd\fR = spmstop.sh
+.br
+The free lock command
+
+\fBthread_pool_size\fR = 10
+.br
+Thread pool size
+
+\fBmax_tasks\fR = 500
+.br
+Number max of tasks
+
+\fBlvm_dev_whitelist\fR
+.br
+LVM whitelist
+
+\fBmd_backup_versions\fR = 30
+.br
+Versions of backup
+
+\fBmd_backup_dir\fR = /var/log/vdsm/backup
+.br
+Backup dir
+
+\fBmaximum_allowed_pvs\fR = 8
+.br
+The number of PVs per VG has a hard-coded limit of 10.
+
+\fBrepo_stats_cache_refresh_timeout\fR = 300
+.br
+Repo stats cache refresh
+
+\fBtask_resource_default_timeout\fR = 120000
+.br
+Task resource default timeout
+
+\fBprepare_image_timeout\fR = 600000
+.br
+Prepare image timeout
+
+\fBgc_blocker_force_collect_interval\fR = 60
+.br
+Force collect interval
+
+\fBmaximum_domains_in_pool\fR = 100
+.br
+Process pool configuration.
+
+\fBprocess_pool_size\fR = 100
+.br
+Pool size
+
+\fBprocess_pool_timeout\fR = 60
+.br
+Pool timeout
+
+\fBprocess_pool_grace_period\fR = 2
+.br
+Pool grace period
+
+\fBprocess_pool_max_slots_per_domain\fR = 10
+.br
+Max slots per domain
+
+\fBiscsi_default_ifaces\fR = default
+.br
+Comma seperated ifaces to connect with. i.e. iser,default
+
+\fBuse_volume_leases\fR = false
+.br
+Whether to use the volume leases or not.
+
+.B [address]
+.br
+\fBmanagement_port\fR = 54321
+.br
+Port on which the vdsmd server listens to network clients
+
+\fBss_pool_timeoutjson_port\fR = 4044
+.br
+Port on which the vdsmd Json RPC server listens to network clients
+
+\fBmanagement_ip\fR
+.br
+IP address of management server
+
+\fBguests_gateway_ip\fR
+.br
+Guests gateway IP address
+
+.SH "SEE ALSO"
+.PP
+
+\fBvdsClient\fR(1),
+\fBvdsmd\fR(8)
+
+.SH AUTHOR
+VDSM was written by Ayal Baron, Barak Azulay, Cyril Plisko, Dan Kenigsberg,
+Doron Fediuck, Igor Lvovsky, Saggi Mizrahi, Shahar Frank, Simon Grinberg and
+others.
+
+.SH BUGS
+Report bugs to <http://bugzilla.redhat.com>
+
+.SH COPYRIGHT
+Copyright 2010-2013 Red Hat, Inc. License GPLv2: GNU GPL Version 2 <http://gnu.org/licenses/gpl.html>.
--
To view, visit http://gerrit.ovirt.org/22891
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8e5a47d484fa06070d4566a39cab8a7a53ea717
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
9 years, 6 months
Change in vdsm[master]: unit_tests: Make run_tests_local.sh not be a generated file
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: unit_tests: Make run_tests_local.sh not be a generated file
......................................................................
unit_tests: Make run_tests_local.sh not be a generated file
It is perfectly possible to simplify run_tests_local.sh.in so that
it does not use macros and this at the same time will allow for
testing subdirectories to use it.
Change-Id: Ie20647b9a7b447b8ed4082f7cefab2146150594e
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
A tests/run_tests_local.sh
D tests/run_tests_local.sh.in
2 files changed, 15 insertions(+), 10 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/32/27632/1
diff --git a/tests/run_tests_local.sh b/tests/run_tests_local.sh
new file mode 100755
index 0000000..b282c10
--- /dev/null
+++ b/tests/run_tests_local.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+if [ -z "$PYTHON_EXE" ]; then
+ ENV_BIN="/usr/bin/env"
+ PYTHON_EXE="python2"
+fi
+
+# The following line is taken from http://stackoverflow.com/a/246128/206009
+# it sets DIR to the path of the directory that contains this bash script
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+if [ ! -f "$DIR/jsonrpc-tests.server.crt" ] || [ ! -f "$DIR/jsonrpc-tests.server.csr" ] || [ ! -f "$DIR/jsonrpc-tests.server.key" ]; then
+ $DIR/makecert.sh
+fi
+
+PYTHONDONTWRITEBYTECODE=1 LC_ALL=C PYTHONPATH="$DIR/../lib:$DIR/../vdsm:$DIR/../client:$DIR/../vdsm_api:$PYTHONPATH" $ENV_BIN "$PYTHON_EXE" $DIR/testrunner.py --local-modules $@
diff --git a/tests/run_tests_local.sh.in b/tests/run_tests_local.sh.in
deleted file mode 100644
index 0a229c0..0000000
--- a/tests/run_tests_local.sh.in
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-if [ -z "$PYTHON_EXE" ]; then
- PYTHON_EXE="@PYTHON@"
-fi
-
-if [ ! -f @top_srcdir(a)/tests/jsonrpc-tests.server.crt ] || [ ! -f @top_srcdir(a)/tests/jsonrpc-tests.server.csr ] || [ ! -f @top_srcdir(a)/tests/jsonrpc-tests.server.key ]; then
- @top_srcdir(a)/tests/makecert.sh
-fi
-
-PYTHONDONTWRITEBYTECODE=1 LC_ALL=C PYTHONPATH="@top_srcdir@/lib:@top_srcdir@/vdsm:@top_srcdir@/client:@top_srcdir@/vdsm_api:$PYTHONPATH" "$PYTHON_EXE" @top_srcdir(a)/tests/testrunner.py --local-modules $@
--
To view, visit http://gerrit.ovirt.org/27632
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie20647b9a7b447b8ed4082f7cefab2146150594e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
9 years, 6 months
Change in vdsm[master]: sampling: do not bail out on errors
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: sampling: do not bail out on errors
......................................................................
sampling: do not bail out on errors
The current sampling code for host stats only handles
TimeoutError gracefully. This is too fragile: the sampling
code should not give up so easily but instead go ahead
in face of errors, as the VmStatsThread already do.
Change-Id: Icd05aecc0f66da2bc75f477afc5e17fada0e5f5b
Relates-To: https://bugzilla.redhat.com/1113948
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/sampling.py
1 file changed, 14 insertions(+), 17 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/01/29401/1
diff --git a/vdsm/virt/sampling.py b/vdsm/virt/sampling.py
index 3b91cee..9c011c5 100644
--- a/vdsm/virt/sampling.py
+++ b/vdsm/virt/sampling.py
@@ -482,23 +482,20 @@
def run(self):
import vm
- try:
- # wait a bit before starting to sample
- time.sleep(self.SAMPLE_INTERVAL_SEC)
- while not self._stopEvent.isSet():
- try:
- sample = self.sample()
- self._samples.append(sample)
- self._lastSampleTime = sample.timestamp
- if len(self._samples) > self.AVERAGING_WINDOW:
- self._samples.pop(0)
- except vm.TimeoutError:
- self._log.error("Timeout while sampling stats",
- exc_info=True)
- self._stopEvent.wait(self.SAMPLE_INTERVAL_SEC)
- except:
- if not self._stopEvent.isSet():
- self._log.error("Error while sampling stats", exc_info=True)
+ # wait a bit before starting to sample
+ time.sleep(self.SAMPLE_INTERVAL_SEC)
+ while not self._stopEvent.isSet():
+ try:
+ sample = self.sample()
+ self._samples.append(sample)
+ self._lastSampleTime = sample.timestamp
+ if len(self._samples) > self.AVERAGING_WINDOW:
+ self._samples.pop(0)
+ except vm.TimeoutError:
+ self._log.exception("Timeout while sampling stats")
+ except Exception:
+ self._log.exception("Error while sampling stats")
+ self._stopEvent.wait(self.SAMPLE_INTERVAL_SEC)
@utils.memoized
def _boot_time(self):
--
To view, visit http://gerrit.ovirt.org/29401
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd05aecc0f66da2bc75f477afc5e17fada0e5f5b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
9 years, 6 months
Change in vdsm[master]: perf: add xml benchmark script
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: perf: add xml benchmark script
......................................................................
perf: add xml benchmark script
Add the script used for the performance tests on this thread:
http://lists.ovirt.org/pipermail/devel/2014-June/007888.html
http://lists.ovirt.org/pipermail/devel/2014-June/007920.html
This is the very first babystep toward an automated
performance test/regression suite.
Change-Id: Ifd166b248532e73ca51fe868d22b909c1237404f
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M contrib/Makefile.am
A contrib/xmlbench.py
2 files changed, 111 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/29402/1
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 537966e..49745bf 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -23,4 +23,5 @@
dist_noinst_PYTHON = \
nfs-check.py \
ivdsm.py \
+ xmlbench.py \
$(NULL)
diff --git a/contrib/xmlbench.py b/contrib/xmlbench.py
new file mode 100755
index 0000000..3f5d47e
--- /dev/null
+++ b/contrib/xmlbench.py
@@ -0,0 +1,110 @@
+#!/usr/bin/env python
+
+import sys
+import threading
+import time
+import xml.dom.minidom
+import xml.etree.cElementTree
+import xml.etree.ElementTree
+
+def eprint(s):
+ sys.stderr.write('%s\n' % s)
+
+try:
+ import psutil
+except ImportError:
+ eprint("you need psutil from https://pypi.python.org/pypi/psutil")
+
+
+
+class Worker(threading.Thread):
+ def __init__(self, func, xml, delay, numruns):
+ super(Worker, self).__init__()
+ self.daemon = True
+ self.func = func
+ self.xml = xml
+ self.delay = delay
+ self.numruns = numruns
+
+ def mustgo(self):
+ if self.numruns is not None:
+ self.numruns -= 1
+ if self.numruns <= 0:
+ return False
+ return True
+
+ def run(self):
+ while self.mustgo():
+ time.sleep(self.delay)
+ self.func(self.xml)
+
+
+PARSERS = {
+ 'md': xml.dom.minidom.parseString,
+ 'et': xml.etree.ElementTree.fromstring,
+ 'cet': xml.etree.cElementTree.fromstring
+}
+
+
+def runner(xml, mode, nthreads, delay, numruns):
+ workers = []
+ for i in range(nthreads):
+ w = Worker(PARSERS[mode], xml, delay, numruns)
+ w.start()
+ workers.append(w)
+
+ p = psutil.Process()
+ p.cpu_percent() # see psutil docs. Discard the first one
+ samples = []
+
+ ts = 0.0
+ while any(w.is_alive() for w in workers):
+ time.sleep(0.5)
+ ts += 0.5
+ samples.append((ts, p.cpu_percent()))
+
+ return samples
+
+
+GNUPLOT_RECIPE = \
+"""
+set datafile separator ","
+set terminal png size 900,400
+set title "XML Processing CPU usage"
+set ylabel "CPU percentage (100% = 1 core)"
+set xlabel "Time"
+#set xdata time
+#set timefmt "%s"
+#set format x "%m/%d"
+set key left top
+set grid
+plot "md.txt" using 1:2 with lines lw 2 lt 3 title 'minidom', \
+ "cet.txt" using 1:2 with lines lw 2 lt 1 title 'cElementTree'
+"""
+
+def _usage():
+ eprint("usage: xmlbench xmlpath mode nthreads [delay [numruns]]")
+ eprint("available modes: %s" % ' '.join(PARSERS.keys()))
+ eprint("plot data using:\n=== CUT HERE ===\n%s\n=== CUT HERE ===\n",
+ GNUPLOT_RECIPE)
+
+def _main(args):
+ if len(args) < 3:
+ _usage()
+ sys.exit(1)
+ else:
+ xmlpath = args[0]
+ mode = args[1]
+ nthreads = int(args[2])
+ delay = int(args[3]) if len(args) > 3 else 15
+ numruns = int(args[4]) if len(args) > 4 else None
+ if mode not in PARSERS:
+ _usage()
+ sys.exit(2)
+ with open(xmlpath, 'rt') as xml:
+ samples = runner(xml.read(), mode, nthreads, delay, numruns)
+ for (ts, value) in samples:
+ print '%f,%f' % (ts, value)
+
+if __name__ == "__main__":
+ _main(sys.argv[1:])
--
To view, visit http://gerrit.ovirt.org/29402
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd166b248532e73ca51fe868d22b909c1237404f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
9 years, 6 months
Change in vdsm[master]: Makefile: add vdsm-reg-setup.in to pyflakes
by Douglas Schilling Landgraf
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: Makefile: add vdsm-reg-setup.in to pyflakes
......................................................................
Makefile: add vdsm-reg-setup.in to pyflakes
We should run pyflakes in vdsm-reg-setup.in as well.
Change-Id: I6be99965f3249374c99c1d4ab71145d571c13921
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M Makefile.am
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/27025/1
diff --git a/Makefile.am b/Makefile.am
index a7fc23f..ea3a4c3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -66,7 +66,8 @@
check-local:
find . -path './.git' -prune -type f -o \
- -name '*.py' -o -name '*.py.in' | xargs $(PYFLAKES) | \
+ -name '*.py' -o -name '*.py.in' -o \
+ -name 'vdsm-reg-setup.in' | xargs $(PYFLAKES) | \
grep -w -v $(SKIP_PYFLAKES_ERR) | \
while read LINE; do echo "$$LINE"; false; done
$(PEP8) --version
--
To view, visit http://gerrit.ovirt.org/27025
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6be99965f3249374c99c1d4ab71145d571c13921
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
9 years, 6 months
Change in vdsm[master]: supervdsm: Switch multiprocessing to CPopen
by dkuznets@redhat.com
Dima Kuznetsov has uploaded a new change for review.
Change subject: supervdsm: Switch multiprocessing to CPopen
......................................................................
supervdsm: Switch multiprocessing to CPopen
Default implementation of multiprocessing.Process used Popen to create
processes, this resulted in zombies being present after the process was
done. This change monkeypatches Process to use cpopen.
Change-Id: I5333caf7a1162c5d783f556bb9204fb74d1ab469
Bug-url: https://bugzilla.redhat.com/show_bug.cgi?id=841486
Signed-off-by: Dima Kuznetsov <dkuznets(a)redhat.com>
---
M vdsm/supervdsmServer
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/15/28915/1
diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
index f9395eb..0a88a21 100755
--- a/vdsm/supervdsmServer
+++ b/vdsm/supervdsmServer
@@ -44,7 +44,9 @@
log.warn("Could not init proper logging", exc_info=True)
from storage import fuser
+import cpopen
from multiprocessing import Pipe, Process
+Process._Popen = cpopen.CPopen
try:
from gluster import listPublicFunctions
_glusterEnabled = True
--
To view, visit http://gerrit.ovirt.org/28915
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5333caf7a1162c5d783f556bb9204fb74d1ab469
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dima Kuznetsov <dkuznets(a)redhat.com>
9 years, 7 months
Change in vdsm[master]: net_tests: Move network unit tests into package
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: net_tests: Move network unit tests into package
......................................................................
net_tests: Move network unit tests into package
This patch brings together the network unit tests under a directory
to improve the organization and as a possible step for a future
cohesive network package with code and tests.
Change-Id: I6960ce365d67ab4bb0a5475d7957e6117bef7e60
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M configure.ac
M tests/Makefile.am
A tests/network/Makefile.am
R tests/network/apiTests.py
R tests/network/ipwrapperTests.py
R tests/network/modelsTests.py
R tests/network/netconfTests.py
R tests/network/netconfpersistenceTests.py
R tests/network/netinfoTests.py
R tests/network/netmaskconversions
R tests/network/tcTests.py
R tests/network/tc_filter_show.out
M tests/run_tests_local.sh.in
13 files changed, 63 insertions(+), 15 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/74/26874/1
diff --git a/configure.ac b/configure.ac
index 12828be..944e17f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -267,6 +267,7 @@
lib/zombiereaper/Makefile
tests/Makefile
tests/functional/Makefile
+ tests/network/Makefile
vds_bootstrap/Makefile
vdsm-tool/Makefile
vdsm/Makefile
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 39c6cad..6fb834f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2012 Red Hat, Inc.
+# Copyright 2012-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
@@ -20,7 +20,7 @@
include $(top_srcdir)/build-aux/Makefile.subs
-SUBDIRS = functional
+SUBDIRS = functional network
test_modules = \
alignmentScanTests.py \
@@ -29,7 +29,6 @@
cPopenTests.py \
capsTests.py \
clientifTests.py \
- configNetworkTests.py \
fileVolumeTests.py \
fileUtilTests.py \
fuserTests.py \
@@ -38,7 +37,6 @@
glusterTestData.py \
guestagentTests.py \
hooksTests.py \
- ipwrapperTests.py \
iscsiTests.py \
jsonRpcTests.py \
jsonRpcUtils.py \
@@ -52,10 +50,6 @@
mkimageTests.py \
monkeypatchTests.py \
mountTests.py \
- netconfpersistenceTests.py \
- netconfTests.py \
- netinfoTests.py \
- netmodelsTests.py \
outOfProcessTests.py \
parted_utils_tests.py \
permutationTests.py \
@@ -66,7 +60,6 @@
securableTests.py \
sslTests.py \
storageMailboxTests.py \
- tcTests.py \
toolTests.py \
transportWrapperTests.py \
utilsTests.py \
@@ -111,8 +104,6 @@
glusterVolumeTasks.xml \
lvs_3386c6f2-926f-42c4-839c-38287fac8998.out \
mem_info.out \
- netmaskconversions \
- tc_filter_show.out \
$(NULL)
dist_vdsmtests_PYTHON = \
diff --git a/tests/network/Makefile.am b/tests/network/Makefile.am
new file mode 100644
index 0000000..f241a4b
--- /dev/null
+++ b/tests/network/Makefile.am
@@ -0,0 +1,53 @@
+#
+# 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
+#
+
+net_testsdir = ${vdsmtestsdir}/network
+
+dist_net_tests_PYTHON = \
+ apiTests.py \
+ ipwrapperTests.py \
+ netconfpersistenceTests.py \
+ netconfTests.py \
+ netinfoTests.py \
+ modelsTests.py \
+ tcTests.py \
+ $(NULL)
+
+MODULES = \
+ network/apiTests.py \
+ network/ipwrapperTests.py \
+ network/netconfpersistenceTests.py \
+ network/netconfTests.py \
+ network/netinfoTests.py \
+ network/modelsTests.py \
+ network/tcTests.py \
+ $(NULL)
+
+
+
+dist_net_tests_DATA = \
+ netmaskconversions \
+ tc_filter_show.out \
+ $(NULL)
+
+check-local:
+ @echo '*** Running network tests. To skip this step place NOSE_EXCLUDE=.* ***'
+ @echo '*** into your environment. Do not submit untested code! ***'
+ $(top_srcdir)/tests/run_tests_local.sh $(MODULES)
diff --git a/tests/configNetworkTests.py b/tests/network/apiTests.py
similarity index 100%
rename from tests/configNetworkTests.py
rename to tests/network/apiTests.py
diff --git a/tests/ipwrapperTests.py b/tests/network/ipwrapperTests.py
similarity index 100%
rename from tests/ipwrapperTests.py
rename to tests/network/ipwrapperTests.py
diff --git a/tests/netmodelsTests.py b/tests/network/modelsTests.py
similarity index 98%
rename from tests/netmodelsTests.py
rename to tests/network/modelsTests.py
index a2a3ee3..5da708b 100644
--- a/tests/netmodelsTests.py
+++ b/tests/network/modelsTests.py
@@ -34,7 +34,7 @@
from monkeypatch import MonkeyPatch
-class TestNetmodels(TestCaseBase):
+class TestModels(TestCaseBase):
def testIsVlanIdValid(self):
vlanIds = ('badValue', Vlan.MAX_ID + 1)
diff --git a/tests/netconfTests.py b/tests/network/netconfTests.py
similarity index 100%
rename from tests/netconfTests.py
rename to tests/network/netconfTests.py
diff --git a/tests/netconfpersistenceTests.py b/tests/network/netconfpersistenceTests.py
similarity index 100%
rename from tests/netconfpersistenceTests.py
rename to tests/network/netconfpersistenceTests.py
diff --git a/tests/netinfoTests.py b/tests/network/netinfoTests.py
similarity index 100%
rename from tests/netinfoTests.py
rename to tests/network/netinfoTests.py
diff --git a/tests/netmaskconversions b/tests/network/netmaskconversions
similarity index 100%
rename from tests/netmaskconversions
rename to tests/network/netmaskconversions
diff --git a/tests/tcTests.py b/tests/network/tcTests.py
similarity index 100%
rename from tests/tcTests.py
rename to tests/network/tcTests.py
diff --git a/tests/tc_filter_show.out b/tests/network/tc_filter_show.out
similarity index 100%
rename from tests/tc_filter_show.out
rename to tests/network/tc_filter_show.out
diff --git a/tests/run_tests_local.sh.in b/tests/run_tests_local.sh.in
index 0a229c0..787d9b2 100644
--- a/tests/run_tests_local.sh.in
+++ b/tests/run_tests_local.sh.in
@@ -3,8 +3,11 @@
PYTHON_EXE="@PYTHON@"
fi
-if [ ! -f @top_srcdir(a)/tests/jsonrpc-tests.server.crt ] || [ ! -f @top_srcdir(a)/tests/jsonrpc-tests.server.csr ] || [ ! -f @top_srcdir(a)/tests/jsonrpc-tests.server.key ]; then
- @top_srcdir(a)/tests/makecert.sh
+# The following line is taken from http://stackoverflow.com/a/246128/206009
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+if [ ! -f "$DIR/jsonrpc-tests.server.crt" ] || [ ! -f "$DIR/jsonrpc-tests.server.csr" ] || [ ! -f "$DIR/jsonrpc-tests.server.key" ]; then
+ $DIR/makecert.sh
fi
-PYTHONDONTWRITEBYTECODE=1 LC_ALL=C PYTHONPATH="@top_srcdir@/lib:@top_srcdir@/vdsm:@top_srcdir@/client:@top_srcdir@/vdsm_api:$PYTHONPATH" "$PYTHON_EXE" @top_srcdir(a)/tests/testrunner.py --local-modules $@
+PYTHONDONTWRITEBYTECODE=1 LC_ALL=C PYTHONPATH="$DIR/../lib:$DIR/../vdsm:$DIR/../client:$DIR/../vdsm_api:$PYTHONPATH" "$PYTHON_EXE" $DIR/testrunner.py --local-modules $@
--
To view, visit http://gerrit.ovirt.org/26874
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6960ce365d67ab4bb0a5475d7957e6117bef7e60
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
9 years, 7 months
Change in vdsm[master]: cleanup: drop several unused local variables
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: cleanup: drop several unused local variables
......................................................................
cleanup: drop several unused local variables
Change-Id: Ib81c292f900154819e8852c21ae389c323034999
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M client/vdsClient.py
M lib/vdsm/netinfo.py
M lib/yajsonrpc/protonReactor.py
M tests/functional/networkTests.py
M tests/functional/virtTests.py
M tests/hookValidation.py
M tests/hooksTests.py
M tests/jsonRpcTests.py
M tests/miscTests.py
M tests/testValidation.py
M tests/vmTests.py
M vds_bootstrap/setup
M vds_bootstrap/vds_bootstrap.py
M vds_bootstrap/vds_bootstrap_complete.py
M vdsm/storage/hsm.py
M vdsm/storage/iscsi.py
M vdsm/storage/misc.py
M vdsm/storage/remoteFileHandler.py
M vdsm/storage/resourceManager.py
M vdsm/storage/sp.py
M vdsm/storage/task.py
M vdsm/vm.py
M vdsm_api/Bridge.py
M vdsm_api/process-schema.py
M vdsm_api/vdsmapi.py
25 files changed, 23 insertions(+), 49 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/20535/1
diff --git a/client/vdsClient.py b/client/vdsClient.py
index 37dd7cb..4c09546 100644
--- a/client/vdsClient.py
+++ b/client/vdsClient.py
@@ -842,7 +842,6 @@
masterDom = args[3]
domList = args[4].split(",")
mVer = int(args[5])
- pool = None
if len(args) > 6:
pool = self.s.createStoragePool(poolType, spUUID,
poolName, masterDom,
diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index e8f2b8d..cf70089 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -93,8 +93,6 @@
The list of nics is built by filtering out nics defined
as hidden, fake or hidden bonds (with related nics'slaves).
"""
- res = []
-
def isHiddenNic(device):
"""
Returns boolean given the device name stating
@@ -397,7 +395,7 @@
"Convert an integer to the corresponding ip address in the dot-notation"
ip_address = []
- for i in xrange(4):
+ for _ in xrange(4):
ip_num, ip_val = divmod(ip_num, 256)
ip_address.append(str(ip_val))
diff --git a/lib/yajsonrpc/protonReactor.py b/lib/yajsonrpc/protonReactor.py
index 557600c..7892e3c 100644
--- a/lib/yajsonrpc/protonReactor.py
+++ b/lib/yajsonrpc/protonReactor.py
@@ -376,7 +376,6 @@
proton.pn_link_advance(link)
def createListener(self, address, acceptHandler):
- host, port = address
return self._scheduleOp(True, self._createListener, address,
acceptHandler)
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index a9149be..ba93343 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -377,7 +377,7 @@
for index in range(VLAN_COUNT)]
with dummyIf(1) as nics:
firstVlan, firstVlanId = NET_VLANS[0]
- status, msg = self.vdsm_net.addNetwork(firstVlan, vlan=firstVlanId,
+ _ = self.vdsm_net.addNetwork(firstVlan, vlan=firstVlanId,
bond=BONDING_NAME,
nics=nics, opts=opts)
with nonChangingOperstate(BONDING_NAME):
diff --git a/tests/functional/virtTests.py b/tests/functional/virtTests.py
index cdb695a..85781f7 100644
--- a/tests/functional/virtTests.py
+++ b/tests/functional/virtTests.py
@@ -83,7 +83,7 @@
def _genInitramfs():
fd, path = tempfile.mkstemp()
cmd = [_mkinitrd.cmd, "-f", path, _kernelVer]
- rc, out, err = execCmd(cmd, sudo=False)
+ _ = execCmd(cmd, sudo=False)
os.chmod(path, 0o644)
return path
diff --git a/tests/hookValidation.py b/tests/hookValidation.py
index 80e7239..208ed35 100644
--- a/tests/hookValidation.py
+++ b/tests/hookValidation.py
@@ -67,8 +67,6 @@
cookie_file = _createHookScript(hook_path, hook_name, hook_script)
- output = None
-
try:
kwargs['hook_cookiefile'] = cookie_file
output = test_function(*args, **kwargs)
diff --git a/tests/hooksTests.py b/tests/hooksTests.py
index 1018a4e..ddb3530 100644
--- a/tests/hooksTests.py
+++ b/tests/hooksTests.py
@@ -42,7 +42,7 @@
echo -n %s >> "$_hook_domxml"
"""
scripts = [tempfile.NamedTemporaryFile(dir=dirName, delete=False)
- for n in xrange(Q)]
+ for _ in xrange(Q)]
scripts.sort(key=lambda f: f.name)
for n, script in enumerate(scripts):
script.write(code % n)
diff --git a/tests/jsonRpcTests.py b/tests/jsonRpcTests.py
index a7b565f..00025ae 100644
--- a/tests/jsonRpcTests.py
+++ b/tests/jsonRpcTests.py
@@ -85,7 +85,7 @@
def serve(reactor):
try:
reactor.process_requests()
- except socket.error as e:
+ except socket.error:
pass
except Exception as e:
self.log.error("Reactor died unexpectedly", exc_info=True)
diff --git a/tests/miscTests.py b/tests/miscTests.py
index c836e55..1a9a16c 100644
--- a/tests/miscTests.py
+++ b/tests/miscTests.py
@@ -432,7 +432,7 @@
os.chmod(dstPath, 0o666)
#Copy
- rc, out, err = misc.ddWatchCopy(srcPath, dstPath, None, len(data))
+ _ = misc.ddWatchCopy(srcPath, dstPath, None, len(data))
#Get copied data
readData = open(dstPath).read()
@@ -448,7 +448,7 @@
fd, path = tempfile.mkstemp()
try:
- for i in xrange(repetitions):
+ for _ in xrange(repetitions):
os.write(fd, data)
self.assertEquals(os.stat(path).st_size, misc.MEGA)
except:
@@ -474,7 +474,7 @@
self.assertEquals(os.stat(path).st_size, misc.MEGA * 2)
with open(path, "r") as f:
- for i in xrange(repetitions):
+ for _ in xrange(repetitions):
self.assertEquals(f.read(len(data)), data)
finally:
os.unlink(path)
@@ -501,7 +501,7 @@
misc.MEGA * 2 + len(add_data))
with open(path, "r") as f:
- for i in xrange(repetitions):
+ for _ in xrange(repetitions):
self.assertEquals(f.read(len(data)), data)
# Checking the additional data
self.assertEquals(f.read(len(add_data)), add_data)
@@ -535,7 +535,7 @@
os.chmod(dstPath, 0o666)
#Copy
- rc, out, err = misc.ddWatchCopy(srcPath, dstPath, None, len(data))
+ _ = misc.ddWatchCopy(srcPath, dstPath, None, len(data))
#Get copied data
readData = open(dstPath).read()
diff --git a/tests/testValidation.py b/tests/testValidation.py
index d370971..92790d9 100644
--- a/tests/testValidation.py
+++ b/tests/testValidation.py
@@ -110,7 +110,7 @@
def wrapper(*args, **kwargs):
if not os.path.exists('/sys/module/dummy'):
cmd_modprobe = [modprobe.cmd, "dummy"]
- rc, out, err = utils.execCmd(cmd_modprobe, sudo=True)
+ _ = utils.execCmd(cmd_modprobe, sudo=True)
return f(*args, **kwargs)
return wrapper
diff --git a/tests/vmTests.py b/tests/vmTests.py
index 1f69f0a..9d91723 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -390,7 +390,7 @@
driveInput.update({'shared': 'UNKNOWN-VALUE'})
with self.assertRaises(ValueError):
- drive = vm.Drive({}, self.log, **driveInput)
+ _ = vm.Drive({}, self.log, **driveInput)
def testDriveXML(self):
SERIAL = '54-a672-23e5b495a9ea'
diff --git a/vds_bootstrap/setup b/vds_bootstrap/setup
index 778dc12..701df8b 100755
--- a/vds_bootstrap/setup
+++ b/vds_bootstrap/setup
@@ -63,7 +63,6 @@
return False, HYPERVISOR_RELEASE_FILE + ", " + REDHAT_RELEASE_FILE
def get_id_line():
- line = ''
RELEASE_FILE = None
try:
@@ -193,7 +192,6 @@
import calendar
return_value = False
- ticket = None
try:
time_struct = time.strptime(systime, '%Y-%m-%dT%H:%M:%S')
diff --git a/vds_bootstrap/vds_bootstrap.py b/vds_bootstrap/vds_bootstrap.py
index a9dc901..e45c8b6 100755
--- a/vds_bootstrap/vds_bootstrap.py
+++ b/vds_bootstrap/vds_bootstrap.py
@@ -289,7 +289,6 @@
"""
status = "OK"
message = 'Host properly registered with RHN/Satellite.'
- rc = True
try:
rc = bool(deployUtil.yumListPackages(VDSM_NAME))
@@ -316,7 +315,6 @@
"""
status = "OK"
message = 'Available VDSM matches requirements'
- rc = True
try:
rc = deployUtil.yumSearchVersion(VDSM_NAME, VDSM_MIN_VER)
@@ -393,7 +391,6 @@
"""
os_status = "FAIL"
kernel_status = "FAIL"
- os_message = "Unsupported platform version"
os_name = "Unknown OS"
kernel_message = ''
self.rc = True
@@ -741,8 +738,6 @@
return self.rc
def _addNetwork(self, vdcName, vdcPort):
- fReturn = True
-
#add management bridge
try:
fReturn = deployUtil.makeBridge(
@@ -859,9 +854,6 @@
# TODO remove legacy
if deployUtil.getBootstrapInterfaceVersion() == 1 and \
engine_ssh_key is None:
- vdcAddress = None
- vdcPort = None
-
vdcAddress, vdcPort = deployUtil.getAddress(url)
if vdcAddress is not None:
strKey = deployUtil.getAuthKeysFile(vdcAddress, vdcPort)
diff --git a/vds_bootstrap/vds_bootstrap_complete.py b/vds_bootstrap/vds_bootstrap_complete.py
index fd18847..07c3610 100755
--- a/vds_bootstrap/vds_bootstrap_complete.py
+++ b/vds_bootstrap/vds_bootstrap_complete.py
@@ -101,7 +101,6 @@
except:
arg = 1
- res = True
try:
res = deployUtil.instCert(rnum, VDSM_CONF_FILE)
if res:
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 4579763..322ee8b 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1095,7 +1095,7 @@
misc.validateN(hostID, 'hostID')
# already disconnected/or pool is just unknown - return OK
try:
- pool = self.getPool(spUUID)
+ _ = self.getPool(spUUID)
except se.StoragePoolUnknown:
self.log.warning("disconnect sp: %s failed. Known pools %s",
spUUID, self.pools)
@@ -1861,7 +1861,7 @@
self.log.info("spUUID=%s master=%s", spUUID, masterDom)
try:
- pool = self.getPool(spUUID)
+ _ = self.getPool(spUUID)
except se.StoragePoolUnknown:
pool = sp.StoragePool(spUUID, self.domainMonitor, self.taskMng)
else:
diff --git a/vdsm/storage/iscsi.py b/vdsm/storage/iscsi.py
index 7da94ab..9976026 100644
--- a/vdsm/storage/iscsi.py
+++ b/vdsm/storage/iscsi.py
@@ -415,7 +415,7 @@
log.debug("Performing SCSI scan, this will take up to %s seconds",
maxTimeout)
time.sleep(minTimeout)
- for i in xrange(maxTimeout - minTimeout):
+ for _ in xrange(maxTimeout - minTimeout):
for p in processes[:]:
(hba, proc) = p
if proc.wait(0):
@@ -429,7 +429,7 @@
time.sleep(1)
else:
log.warning("Still waiting for scsi scan of hbas: %s",
- tuple(hba for p in processes))
+ tuple(hba for _ in processes))
def devIsiSCSI(dev):
diff --git a/vdsm/storage/misc.py b/vdsm/storage/misc.py
index fc13a9c..5245264 100644
--- a/vdsm/storage/misc.py
+++ b/vdsm/storage/misc.py
@@ -484,7 +484,6 @@
log.debug("dir: %s, prefixName: %s, versions: %s" %
(directory, prefixName, gen))
gen = int(gen)
- files = os.listdir(directory)
files = glob.glob("%s*" % prefixName)
fd = {}
for fname in files:
@@ -614,7 +613,6 @@
return self.acquire(True)
def acquire(self, exclusive):
- currentEvent = None
currentThread = threading.currentThread()
# Handle reacquiring lock in the same thread
@@ -1081,7 +1079,7 @@
maxthreads -= 1
# waiting for rest threads to end
- for i in xrange(threadsCount):
+ for _ in xrange(threadsCount):
yield respQueue.get()
diff --git a/vdsm/storage/remoteFileHandler.py b/vdsm/storage/remoteFileHandler.py
index 5b24053..accf51c 100644
--- a/vdsm/storage/remoteFileHandler.py
+++ b/vdsm/storage/remoteFileHandler.py
@@ -275,7 +275,7 @@
def __init__(self, numOfHandlers):
self._numOfHandlers = numOfHandlers
self.handlers = [None] * numOfHandlers
- self.occupied = [Lock() for i in xrange(numOfHandlers)]
+ self.occupied = [Lock() for _ in xrange(numOfHandlers)]
def _isHandlerAvailable(self, poolHandler):
if poolHandler is None:
diff --git a/vdsm/storage/resourceManager.py b/vdsm/storage/resourceManager.py
index 14049dc..486ea18 100644
--- a/vdsm/storage/resourceManager.py
+++ b/vdsm/storage/resourceManager.py
@@ -926,7 +926,7 @@
return req.wait(timeout)
# req not found - check that it is not granted
- for fullName in self.resources:
+ for _ in self.resources:
return True
# Note that there is a risk of another thread that is racing with us
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 38cd453..db66662 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -1326,7 +1326,6 @@
self.log.info("spUUID=%s sdUUID=%s", self.spUUID, sdUUID)
vms = self._getVMsPath(sdUUID)
# We should exclude 'masterd' link from IMG_METAPATTERN globing
- vmUUID = ovf = imgList = ''
for vm in vmList:
if not vm:
continue
diff --git a/vdsm/storage/task.py b/vdsm/storage/task.py
index 4eff5c1..0532b02 100644
--- a/vdsm/storage/task.py
+++ b/vdsm/storage/task.py
@@ -872,10 +872,7 @@
def _runJobs(self):
result = ""
- code = 100
- message = "Unknown Error"
i = 0
- j = None
try:
if self.aborting():
raise se.TaskAborted("shutting down")
@@ -891,7 +888,6 @@
if result is None:
result = ""
i += 1
- j = None
self._updateResult(0, "%s jobs completed successfully" % i, result)
self._updateState(State.finished)
self.log.debug('Task.run: exit - success: result %s' % result)
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 0c12334..5e1c7f1 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -3058,7 +3058,7 @@
self._dom.attachDevice(nicXml)
except libvirt.libvirtError as e:
self.log.error("Hotplug failed", exc_info=True)
- nicXml = hooks.after_nic_hotplug_fail(
+ _ = hooks.after_nic_hotplug_fail(
nicXml, self.conf, params=customProps)
if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN:
return errCode['noVM']
@@ -3760,7 +3760,7 @@
"trying again without it (%s)", e)
try:
self._dom.snapshotCreateXML(snapxml, snapFlags)
- except Exception as e:
+ except Exception:
self.log.error("Unable to take snapshot", exc_info=True)
if memoryParams:
self.cif.teardownVolumePath(memoryVol)
diff --git a/vdsm_api/Bridge.py b/vdsm_api/Bridge.py
index b9fdaf8..4812354 100644
--- a/vdsm_api/Bridge.py
+++ b/vdsm_api/Bridge.py
@@ -34,7 +34,6 @@
def dispatch(self, name, argobj):
methodName = name.replace('.', '_')
- result = None
try:
fn = getattr(self, methodName)
except AttributeError:
diff --git a/vdsm_api/process-schema.py b/vdsm_api/process-schema.py
index c4bda0d..307d498 100755
--- a/vdsm_api/process-schema.py
+++ b/vdsm_api/process-schema.py
@@ -255,12 +255,12 @@
# Union member types
names = strip_stars(s.get('data', []))
types = filter_types(names)
- details = [None for n in names]
+ details = [None for _ in names]
attr_table('Types', names, types, details)
elif 'enum' in s:
# Enum values
names = strip_stars(s.get('data', []))
- types = [None for n in names]
+ types = [None for _ in names]
details = [s['info_data'][n] for n in names]
attr_table('Values', names, types, details)
elif 'map' in s:
diff --git a/vdsm_api/vdsmapi.py b/vdsm_api/vdsmapi.py
index db29c13..c38ff01 100644
--- a/vdsm_api/vdsmapi.py
+++ b/vdsm_api/vdsmapi.py
@@ -92,7 +92,6 @@
def parse_schema(fp):
exprs = []
expr = ''
- expr_eval = None
for line in fp:
if line.startswith('#') or line == '\n':
--
To view, visit http://gerrit.ovirt.org/20535
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib81c292f900154819e8852c21ae389c323034999
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
9 years, 7 months
Change in vdsm[master]: vm: migration: exponential downtime increment
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: vm: migration: exponential downtime increment
......................................................................
vm: migration: exponential downtime increment
Migration downtime is calculated using an interpolation
using the current downtime step (up to a configurabile
maximum) and the maximum downtime.
The downtime is incremented at each downtime step until
it reaches the maximum, or the migration is finished.
This patch changes the interpolation formula from linear
to exponential, being the new one:
d = c ** s
where d is the downtime, s is the step and c is the
exponentiation coefficient computed in such a way
of when s = S (number of steps to perform),
then we will have d = D (selected downtime).
Please note that this patch still preserve an linear
increment of the wait time.
Change-Id: I6401772f52ea28144452e67198bddff18f6703eb
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1004101
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/20/25820/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index c53f1d4..1d7b643 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -722,6 +722,7 @@
delay_per_gib = config.getint('vars', 'migration_downtime_delay')
memSize = int(vm.conf['memSize'])
self._wait = (delay_per_gib * max(memSize, 2048) + 1023) / 1024
+ self._coeff = self._downtime ** (1 / float(self.DOWNTIME_STEPS))
self.daemon = True
self.start()
@@ -735,7 +736,7 @@
if self._stop.isSet():
break
- downtime = self._downtime * (i + 1) / self.DOWNTIME_STEPS
+ downtime = int(self._coeff ** i)
self._vm.log.debug('setting migration downtime to %d', downtime)
self._vm._dom.migrateSetMaxDowntime(downtime, 0)
--
To view, visit http://gerrit.ovirt.org/25820
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6401772f52ea28144452e67198bddff18f6703eb
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
9 years, 7 months
Change in vdsm[master]: virt: drop needless configurable
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: virt: drop needless configurable
......................................................................
virt: drop needless configurable
There is no need to keep more than one sample of balloon size, but our
sampling framework can handle no less than two samples, but only the
last sample is used. In any case, we should not expose the number of
samples to the end user, it only complicates the config file with no
benefit.
Change-Id: I6e66f18706761ada045799f0f6d488a2c9ef6553
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M lib/vdsm/config.py.in
M vdsm/virt/vm.py
2 files changed, 1 insertion(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/28808/1
diff --git a/lib/vdsm/config.py.in b/lib/vdsm/config.py.in
index 76d77a1..09113f5 100644
--- a/lib/vdsm/config.py.in
+++ b/lib/vdsm/config.py.in
@@ -168,8 +168,6 @@
('vm_sample_balloon_interval', '15', None),
- ('vm_sample_balloon_window', '2', None),
-
('vm_sample_jobs_interval', '15', None),
# TODO: Change this to 1 once AdvancedStatsFunction can support it
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index d66458d..774a47c 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -209,7 +209,7 @@
sampling.AdvancedStatsFunction(
self._sampleBalloon,
config.getint('vars', 'vm_sample_balloon_interval'),
- config.getint('vars', 'vm_sample_balloon_window')))
+ 2))
self.sampleVmJobs = (
sampling.AdvancedStatsFunction(
self._sampleVmJobs,
--
To view, visit http://gerrit.ovirt.org/28808
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e66f18706761ada045799f0f6d488a2c9ef6553
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
9 years, 7 months