Change in vdsm[ovirt-3.6]: revert "storage: validate vdsm rwx permissions for file stor...
by gpadgett@redhat.com
Greg Padgett has uploaded a new change for review.
Change subject: revert "storage: validate vdsm rwx permissions for file storage"
......................................................................
revert "storage: validate vdsm rwx permissions for file storage"
This reverts commit 777c36d64f9fe0aee69fe6ed9049262accff54d3
The above patch triggers a race condition in supervdsm's _runAs()
method which can prevent file-based storage domains from being added,
thus this patch needs to be reverted.
Change-Id: I2a602a08d0588af13d44947faf054d88ea9acc5f
Bug-Url: https://bugzilla.redhat.com/1259310
Related-To: https://bugzilla.redhat.com/1250752
Signed-off-by: Greg Padgett <gpadgett(a)redhat.com>
Reviewed-on: https://gerrit.ovirt.org/45891
Continuous-Integration: Jenkins CI
---
M vdsm/storage/fileSD.py
1 file changed, 0 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/45892/1
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index ec46d18..2feb6b5 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -67,10 +67,6 @@
try:
getProcPool().fileUtils.validateAccess(dirPath)
supervdsm.getProxy().validateAccess(
- constants.VDSM_USER,
- (constants.VDSM_GROUP,), dirPath,
- (os.R_OK | os.W_OK | os.X_OK))
- supervdsm.getProxy().validateAccess(
constants.QEMU_PROCESS_USER,
(constants.DISKIMAGE_GROUP, constants.METADATA_GROUP), dirPath,
(os.R_OK | os.X_OK))
--
To view, visit https://gerrit.ovirt.org/45892
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a602a08d0588af13d44947faf054d88ea9acc5f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Greg Padgett <gpadgett(a)redhat.com>
8 years, 8 months
Change in vdsm[master]: revert "storage: validate vdsm rwx permissions for file stor...
by gpadgett@redhat.com
Greg Padgett has uploaded a new change for review.
Change subject: revert "storage: validate vdsm rwx permissions for file storage"
......................................................................
revert "storage: validate vdsm rwx permissions for file storage"
This reverts commit 777c36d64f9fe0aee69fe6ed9049262accff54d3
The above patch triggers a race condition in supervdsm's _runAs()
method which can prevent file-based storage domains from being added,
thus this patch needs to be reverted.
Change-Id: I2a602a08d0588af13d44947faf054d88ea9acc5f
Bug-Url: https://bugzilla.redhat.com/1259310
Related-To: https://bugzilla.redhat.com/1250752
Signed-off-by: Greg Padgett <gpadgett(a)redhat.com>
---
M vdsm/storage/fileSD.py
1 file changed, 0 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/91/45891/1
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index 5c9aa6d..b74b4b4 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -67,10 +67,6 @@
try:
getProcPool().fileUtils.validateAccess(dirPath)
supervdsm.getProxy().validateAccess(
- constants.VDSM_USER,
- (constants.VDSM_GROUP,), dirPath,
- (os.R_OK | os.W_OK | os.X_OK))
- supervdsm.getProxy().validateAccess(
constants.QEMU_PROCESS_USER,
(constants.DISKIMAGE_GROUP, constants.METADATA_GROUP), dirPath,
(os.R_OK | os.X_OK))
--
To view, visit https://gerrit.ovirt.org/45891
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a602a08d0588af13d44947faf054d88ea9acc5f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <gpadgett(a)redhat.com>
8 years, 8 months
Change in vdsm[ovirt-3.5]: vm.py: State saving in hotunplugDisk.
by automation@ovirt.org
automation(a)ovirt.org has posted comments on this change.
Change subject: vm.py: State saving in hotunplugDisk.
......................................................................
Patch Set 2: -Verified
* update_tracker: OK
* Check Bug-Url::OK
* Check Public Bug::#1258452::ERROR, private bug
* Check Public Bug::WARN, no public bug url found
* Check merged to previous::OK, change not open on any previous branch
--
To view, visit https://gerrit.ovirt.org/45928
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I2cf18186cbba33d7e74fd15651ffec3149c98e1d
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Tal Nisan <tnisan(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
8 years, 8 months
Change in vdsm[ovirt-3.5]: vm.py: State saving in hotunplugDisk.
by automation@ovirt.org
automation(a)ovirt.org has posted comments on this change.
Change subject: vm.py: State saving in hotunplugDisk.
......................................................................
Patch Set 1: Verified-1
* Update tracker::IGNORE, no Bug-Url found
* Check Bug-Url::ERROR, At least one bug-url is required for the stable branch
* Check merged to previous::OK, change not open on any previous branch
--
To view, visit https://gerrit.ovirt.org/45928
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I2cf18186cbba33d7e74fd15651ffec3149c98e1d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Tal Nisan <tnisan(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
8 years, 8 months
Change in vdsm[master]: supervdsm: don't let _runAs return early due to EINTR
by gpadgett@redhat.com
Greg Padgett has uploaded a new change for review.
Change subject: supervdsm: don't let _runAs return early due to EINTR
......................................................................
supervdsm: don't let _runAs return early due to EINTR
When _runAs executes a command, it polls a pipe to determine status of
that command. The poll has a timeout, also allowing the child to be
killed if execution takes too long. If a stray signal is received by
the parent process, it may cause the poll to return early, prematurely
ending child command execution ending in unintentional failure.
This is particularly prevalant when subsequent _runAs executions are
performed. Termination of the first will result in a SIGCHLD which
interrupts polling for the second, as exposed by commit 777c36d6.
Because poll will return early without an exception if the low-level
call is interrupted, NoIntrCall() cannot be used and thus a new helper
function is provided that retries based on the time elapsed since the
call started.
PEP-475 will handle this in Python 3.5, but in the meantime this
workaround is needed.
Change-Id: I25af73a8fe67e7bc434f60a7d8492e33dc3b2ffa
Bug-Url: https://bugzilla.redhat.com/1259310
Signed-off-by: Greg Padgett <gpadgett(a)redhat.com>
---
M lib/vdsm/utils.py
M vdsm/supervdsmServer
2 files changed, 19 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/52/45752/1
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index d847a23..4ba6452 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -348,6 +348,24 @@
break
+def NoIntrMPConnPoll(mpConnection, timeout):
+ """
+ This is a workaround until we get the PEP-475 fix for EINTR. It
+ ensures that a multiprocessing.connection.poll() will not return
+ before the timeout due to an interruption.
+ """
+ end = monotonic_time() + timeout
+ remaining = timeout
+
+ while not mpConnection.poll(remaining):
+ remaining = end - monotonic_time()
+ if remaining > 0:
+ continue
+ return False
+
+ return True
+
+
class CommandStream(object):
def __init__(self, command, stdoutcb, stderrcb):
self._command = command
diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
index 3d64843..276a694 100755
--- a/vdsm/supervdsmServer
+++ b/vdsm/supervdsmServer
@@ -245,7 +245,7 @@
needReaping = True
try:
- if not pipe.poll(RUN_AS_TIMEOUT):
+ if not utils.NoIntrMPConnPoll(pipe, RUN_AS_TIMEOUT):
try:
os.kill(proc.pid, signal.SIGKILL)
--
To view, visit https://gerrit.ovirt.org/45752
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I25af73a8fe67e7bc434f60a7d8492e33dc3b2ffa
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <gpadgett(a)redhat.com>
8 years, 8 months
Change in vdsm[ovirt-3.6]: supervdsm: don't let _runAs return early due to EINTR
by gpadgett@redhat.com
Hello Greg Padgett,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/45885
to review the following change.
Change subject: supervdsm: don't let _runAs return early due to EINTR
......................................................................
supervdsm: don't let _runAs return early due to EINTR
When _runAs executes a command, it polls a pipe to determine status of
that command. The poll has a timeout, also allowing the child to be
killed if execution takes too long. If a stray signal is received by
the parent process, it may cause the poll to return early, prematurely
ending child command execution ending in unintentional failure.
This is particularly prevalant when subsequent _runAs executions are
performed. Termination of the first will result in a SIGCHLD which
interrupts polling for the second, as exposed by commit 777c36d6.
Because poll will return early without an exception if the low-level
call is interrupted, NoIntrCall() cannot be used and thus a new helper
function is provided that retries based on the time elapsed since the
call started.
PEP-475 will handle this in Python 3.5, but in the meantime this
workaround is needed.
Change-Id: I25af73a8fe67e7bc434f60a7d8492e33dc3b2ffa
Backport-To: 3.6
Bug-Url: https://bugzilla.redhat.com/1259310
Signed-off-by: Greg Padgett <gpadgett(a)redhat.com>
Reviewed-On: https://gerrit.ovirt.org/45752
Continuous-Integration: Jenkins CI
Reviewed-by: Nir Soffer <nsoffer(a)redhat.com>
Tested-by: Greg Padgett <gdpadgett(a)gmail.com>
---
M vdsm/supervdsmServer
1 file changed, 21 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/85/45885/1
diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
index 978fc18..c5766a3 100755
--- a/vdsm/supervdsmServer
+++ b/vdsm/supervdsmServer
@@ -118,6 +118,26 @@
return wrapper
+def safe_poll(mp_connection, timeout):
+ """
+ This is a workaround until we get the PEP-475 fix for EINTR. It
+ ensures that a multiprocessing.connection.poll() will not return
+ before the timeout due to an interruption.
+
+ Returns True if there is any data to read from the pipe or if the
+ pipe was closed. Returns False if the timeout expired.
+ """
+ deadline = utils.monotonic_time() + timeout
+ remaining = timeout
+
+ while not mp_connection.poll(remaining):
+ remaining = deadline - utils.monotonic_time()
+ if remaining <= 0:
+ return False
+
+ return True
+
+
class _SuperVdsm(object):
UDEV_WITH_RELOAD_VERSION = 181
@@ -246,7 +266,7 @@
needReaping = True
try:
- if not pipe.poll(RUN_AS_TIMEOUT):
+ if not safe_poll(pipe, RUN_AS_TIMEOUT):
try:
os.kill(proc.pid, signal.SIGKILL)
--
To view, visit https://gerrit.ovirt.org/45885
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I25af73a8fe67e7bc434f60a7d8492e33dc3b2ffa
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Greg Padgett <gpadgett(a)redhat.com>
Gerrit-Reviewer: Greg Padgett <gdpadgett(a)gmail.com>
8 years, 8 months
Change in vdsm[master]: net: fix test_getVdsStats
by phoracek@redhat.com
Petr Horáček has uploaded a new change for review.
Change subject: net: fix test_getVdsStats
......................................................................
net: fix test_getVdsStats
TODO
Change-Id: Ib41b6c942a5f7158e7520e9f6dfda338a71b19e2
Signed-off-by: Petr Horáček <phoracek(a)redhat.com>
---
M tests/functional/networkTests.py
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/56/45756/1
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index 1873222..f898fb7 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -436,6 +436,9 @@
veth.setLinkUp(right)
# Vdsm scans for new devices every 15 seconds
+ # XXX: NOT TRUE, it takes 60-90 secs to show a new dummy or veth,
+ # and even when it caught it, it ends with:
+ # AssertionError: sampleTime is not monotonically increasing
self.retryAssert(
assertTestDevStatsReported, timeout=20)
--
To view, visit https://gerrit.ovirt.org/45756
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib41b6c942a5f7158e7520e9f6dfda338a71b19e2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
8 years, 8 months
Change in vdsm[master]: caps: more precise emulated machines selection
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: caps: more precise emulated machines selection
......................................................................
caps: more precise emulated machines selection
Current VDSM code fetches emulated machines from the section which matches
first the required architecture.
This works in the simplest (and the only recommended) case, but doesn't
if, for any reason, there is more than one valid emulatore for a given
architecture.
The only known case is if the user managed to install qemu-kvm alongside
plain qemu.
This patch implements more robust capabilities fetching to deal with
this corner case.
Change-Id: I4deebbc90bf1cec53fc40bc6a35c6ada933296c3
Bug-Url: https://bugzilla.redhat.com/1239258
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M tests/capsTests.py
A tests/caps_libvirt_multiqemu.out
M vdsm/caps.py
3 files changed, 608 insertions(+), 12 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/57/45257/1
diff --git a/tests/capsTests.py b/tests/capsTests.py
index 1bdccce..a70de5f 100644
--- a/tests/capsTests.py
+++ b/tests/capsTests.py
@@ -317,6 +317,24 @@
'pc-i440fx-rhel7.0.0']
self.assertEqual(expected, result)
+ def test_getEmulatedMachinesWithTwoQEMUInstalled(self):
+ capsData = self._readCaps("caps_libvirt_multiqemu.out")
+ result = caps._getEmulatedMachines('x86_64', capsData)
+ expected = ['pc-i440fx-rhel7.1.0',
+ 'rhel6.3.0',
+ 'pc-q35-rhel7.0.0',
+ 'rhel6.1.0',
+ 'rhel6.6.0',
+ 'rhel6.2.0',
+ 'pc',
+ 'pc-q35-rhel7.1.0',
+ 'q35',
+ 'rhel6.4.0',
+ 'rhel6.0.0',
+ 'rhel6.5.0',
+ 'pc-i440fx-rhel7.0.0']
+ self.assertEqual(expected, result)
+
def test_getNumaTopology(self):
capsData = self._readCaps("caps_libvirt_intel_i73770_nosnap.out")
result = caps.getNumaTopology(capsData)
diff --git a/tests/caps_libvirt_multiqemu.out b/tests/caps_libvirt_multiqemu.out
new file mode 100644
index 0000000..38e962f
--- /dev/null
+++ b/tests/caps_libvirt_multiqemu.out
@@ -0,0 +1,547 @@
+<capabilities>
+
+ <host>
+ <uuid>8760ad12-e4e8-43ca-8a11-93c59fbf148d</uuid>
+ <cpu>
+ <arch>x86_64</arch>
+ <model>SandyBridge</model>
+ <vendor>Intel</vendor>
+ <topology sockets='1' cores='6' threads='2'/>
+ <feature name='invtsc'/>
+ <feature name='invpcid'/>
+ <feature name='erms'/>
+ <feature name='bmi2'/>
+ <feature name='smep'/>
+ <feature name='avx2'/>
+ <feature name='bmi1'/>
+ <feature name='fsgsbase'/>
+ <feature name='abm'/>
+ <feature name='pdpe1gb'/>
+ <feature name='rdrand'/>
+ <feature name='f16c'/>
+ <feature name='osxsave'/>
+ <feature name='movbe'/>
+ <feature name='dca'/>
+ <feature name='pcid'/>
+ <feature name='pdcm'/>
+ <feature name='xtpr'/>
+ <feature name='fma'/>
+ <feature name='tm2'/>
+ <feature name='est'/>
+ <feature name='smx'/>
+ <feature name='vmx'/>
+ <feature name='ds_cpl'/>
+ <feature name='monitor'/>
+ <feature name='dtes64'/>
+ <feature name='pbe'/>
+ <feature name='tm'/>
+ <feature name='ht'/>
+ <feature name='ss'/>
+ <feature name='acpi'/>
+ <feature name='ds'/>
+ <feature name='vme'/>
+ <pages unit='KiB' size='4'/>
+ <pages unit='KiB' size='2048'/>
+ </cpu>
+ <power_management>
+ <suspend_mem/>
+ </power_management>
+ <migration_features>
+ <live/>
+ <uri_transports>
+ <uri_transport>tcp</uri_transport>
+ <uri_transport>rdma</uri_transport>
+ </uri_transports>
+ </migration_features>
+ <topology>
+ <cells num='2'>
+ <cell id='0'>
+ <memory unit='KiB'>33444704</memory>
+ <pages unit='KiB' size='4'>8361176</pages>
+ <pages unit='KiB' size='2048'>0</pages>
+ <distances>
+ <sibling id='0' value='10'/>
+ <sibling id='1' value='21'/>
+ </distances>
+ <cpus num='12'>
+ <cpu id='0' socket_id='0' core_id='0' siblings='0,12'/>
+ <cpu id='1' socket_id='0' core_id='1' siblings='1,13'/>
+ <cpu id='2' socket_id='0' core_id='2' siblings='2,14'/>
+ <cpu id='3' socket_id='0' core_id='3' siblings='3,15'/>
+ <cpu id='4' socket_id='0' core_id='4' siblings='4,16'/>
+ <cpu id='5' socket_id='0' core_id='5' siblings='5,17'/>
+ <cpu id='12' socket_id='0' core_id='0' siblings='0,12'/>
+ <cpu id='13' socket_id='0' core_id='1' siblings='1,13'/>
+ <cpu id='14' socket_id='0' core_id='2' siblings='2,14'/>
+ <cpu id='15' socket_id='0' core_id='3' siblings='3,15'/>
+ <cpu id='16' socket_id='0' core_id='4' siblings='4,16'/>
+ <cpu id='17' socket_id='0' core_id='5' siblings='5,17'/>
+ </cpus>
+ </cell>
+ <cell id='1'>
+ <memory unit='KiB'>33554432</memory>
+ <pages unit='KiB' size='4'>8388608</pages>
+ <pages unit='KiB' size='2048'>0</pages>
+ <distances>
+ <sibling id='0' value='21'/>
+ <sibling id='1' value='10'/>
+ </distances>
+ <cpus num='12'>
+ <cpu id='6' socket_id='1' core_id='0' siblings='6,18'/>
+ <cpu id='7' socket_id='1' core_id='1' siblings='7,19'/>
+ <cpu id='8' socket_id='1' core_id='2' siblings='8,20'/>
+ <cpu id='9' socket_id='1' core_id='3' siblings='9,21'/>
+ <cpu id='10' socket_id='1' core_id='4' siblings='10,22'/>
+ <cpu id='11' socket_id='1' core_id='5' siblings='11,23'/>
+ <cpu id='18' socket_id='1' core_id='0' siblings='6,18'/>
+ <cpu id='19' socket_id='1' core_id='1' siblings='7,19'/>
+ <cpu id='20' socket_id='1' core_id='2' siblings='8,20'/>
+ <cpu id='21' socket_id='1' core_id='3' siblings='9,21'/>
+ <cpu id='22' socket_id='1' core_id='4' siblings='10,22'/>
+ <cpu id='23' socket_id='1' core_id='5' siblings='11,23'/>
+ </cpus>
+ </cell>
+ </cells>
+ </topology>
+ <secmodel>
+ <model>selinux</model>
+ <doi>0</doi>
+ <baselabel type='kvm'>system_u:system_r:svirt_t:s0</baselabel>
+ <baselabel type='qemu'>system_u:system_r:svirt_tcg_t:s0</baselabel>
+ </secmodel>
+ <secmodel>
+ <model>dac</model>
+ <doi>0</doi>
+ <baselabel type='kvm'>+107:+107</baselabel>
+ <baselabel type='qemu'>+107:+107</baselabel>
+ </secmodel>
+ </host>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='alpha'>
+ <wordsize>64</wordsize>
+ <emulator>/usr/bin/qemu-system-alpha</emulator>
+ <machine maxCpus='4'>clipper</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <deviceboot/>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='armv7l'>
+ <wordsize>32</wordsize>
+ <emulator>/usr/bin/qemu-system-arm</emulator>
+ <machine maxCpus='1'>borzoi</machine>
+ <machine maxCpus='4'>virt</machine>
+ <machine maxCpus='4'>midway</machine>
+ <machine maxCpus='1'>tosa</machine>
+ <machine maxCpus='1'>cheetah</machine>
+ <machine maxCpus='1'>realview-pb-a8</machine>
+ <machine maxCpus='1'>collie</machine>
+ <machine maxCpus='1'>n800</machine>
+ <machine maxCpus='4'>highbank</machine>
+ <machine maxCpus='1'>kzm</machine>
+ <machine maxCpus='1'>integratorcp</machine>
+ <machine maxCpus='1'>sx1-v1</machine>
+ <machine maxCpus='2'>smdkc210</machine>
+ <machine maxCpus='1'>akita</machine>
+ <machine maxCpus='1'>canon-a1100</machine>
+ <machine maxCpus='1'>spitz</machine>
+ <machine maxCpus='1'>verdex</machine>
+ <machine maxCpus='1'>xilinx-zynq-a9</machine>
+ <machine maxCpus='4'>realview-eb-mpcore</machine>
+ <machine maxCpus='2'>nuri</machine>
+ <machine maxCpus='4'>vexpress-a15</machine>
+ <machine maxCpus='1'>n810</machine>
+ <machine maxCpus='1'>terrier</machine>
+ <machine maxCpus='1'>mainstone</machine>
+ <machine maxCpus='1'>musicpal</machine>
+ <machine maxCpus='4'>realview-pbx-a9</machine>
+ <machine maxCpus='1'>lm3s6965evb</machine>
+ <machine maxCpus='4'>vexpress-a9</machine>
+ <machine maxCpus='1'>cubieboard</machine>
+ <machine maxCpus='1'>realview-eb</machine>
+ <machine maxCpus='1'>sx1</machine>
+ <machine maxCpus='1'>connex</machine>
+ <machine maxCpus='1'>z2</machine>
+ <machine maxCpus='1'>lm3s811evb</machine>
+ <machine maxCpus='1'>versatilepb</machine>
+ <machine maxCpus='1'>versatileab</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <cpuselection/>
+ <deviceboot/>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='cris'>
+ <wordsize>32</wordsize>
+ <emulator>/usr/bin/qemu-system-cris</emulator>
+ <machine maxCpus='1'>axis-dev88</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='i686'>
+ <wordsize>32</wordsize>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <machine canonical='pc-i440fx-2.0' maxCpus='255'>pc</machine>
+ <machine maxCpus='255'>pc-0.12</machine>
+ <machine maxCpus='255'>pc-1.3</machine>
+ <machine maxCpus='255'>pc-q35-1.6</machine>
+ <machine maxCpus='255'>pc-q35-1.5</machine>
+ <machine maxCpus='255'>pc-i440fx-1.6</machine>
+ <machine maxCpus='255'>pc-i440fx-1.7</machine>
+ <machine maxCpus='255'>pc-0.11</machine>
+ <machine maxCpus='255'>pc-0.10</machine>
+ <machine maxCpus='255'>pc-1.2</machine>
+ <machine maxCpus='1'>isapc</machine>
+ <machine maxCpus='255'>pc-q35-1.4</machine>
+ <machine maxCpus='255'>pc-0.15</machine>
+ <machine maxCpus='255'>pc-0.14</machine>
+ <machine maxCpus='255'>pc-i440fx-1.5</machine>
+ <machine canonical='pc-q35-2.0' maxCpus='255'>q35</machine>
+ <machine maxCpus='255'>pc-i440fx-1.4</machine>
+ <machine maxCpus='255'>pc-1.1</machine>
+ <machine maxCpus='255'>pc-q35-1.7</machine>
+ <machine maxCpus='255'>pc-1.0</machine>
+ <machine maxCpus='255'>pc-0.13</machine>
+ <domain type='qemu'>
+ </domain>
+ <domain type='kvm'>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <machine canonical='pc-i440fx-rhel7.1.0' maxCpus='240'>pc</machine>
+ <machine maxCpus='240'>rhel6.6.0</machine>
+ <machine maxCpus='240'>pc-q35-rhel7.0.0</machine>
+ <machine maxCpus='240'>rhel6.4.0</machine>
+ <machine canonical='pc-q35-rhel7.1.0' maxCpus='240'>q35</machine>
+ <machine maxCpus='240'>pc-i440fx-rhel7.0.0</machine>
+ <machine maxCpus='240'>rhel6.2.0</machine>
+ <machine maxCpus='240'>rhel6.1.0</machine>
+ <machine maxCpus='240'>rhel6.5.0</machine>
+ <machine maxCpus='240'>rhel6.0.0</machine>
+ <machine maxCpus='240'>rhel6.3.0</machine>
+ </domain>
+ </arch>
+ <features>
+ <cpuselection/>
+ <deviceboot/>
+ <disksnapshot default='on' toggle='no'/>
+ <acpi default='on' toggle='yes'/>
+ <apic default='on' toggle='no'/>
+ <pae/>
+ <nonpae/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='lm32'>
+ <wordsize>32</wordsize>
+ <emulator>/usr/bin/qemu-system-lm32</emulator>
+ <machine maxCpus='1'>lm32-evr</machine>
+ <machine maxCpus='1'>milkymist</machine>
+ <machine maxCpus='1'>lm32-uclinux</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='m68k'>
+ <wordsize>32</wordsize>
+ <emulator>/usr/bin/qemu-system-m68k</emulator>
+ <machine maxCpus='1'>mcf5208evb</machine>
+ <machine maxCpus='1'>dummy</machine>
+ <machine maxCpus='1'>an5206</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <deviceboot/>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='microblaze'>
+ <wordsize>32</wordsize>
+ <emulator>/usr/bin/qemu-system-microblaze</emulator>
+ <machine maxCpus='1'>petalogix-s3adsp1800</machine>
+ <machine maxCpus='1'>petalogix-ml605</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='microblazeel'>
+ <wordsize>32</wordsize>
+ <emulator>/usr/bin/qemu-system-microblazeel</emulator>
+ <machine maxCpus='1'>petalogix-s3adsp1800</machine>
+ <machine maxCpus='1'>petalogix-ml605</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='mips'>
+ <wordsize>32</wordsize>
+ <emulator>/usr/bin/qemu-system-mips</emulator>
+ <machine maxCpus='16'>malta</machine>
+ <machine maxCpus='1'>mipssim</machine>
+ <machine maxCpus='1'>magnum</machine>
+ <machine maxCpus='1'>pica61</machine>
+ <machine maxCpus='1'>mips</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <deviceboot/>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='mipsel'>
+ <wordsize>32</wordsize>
+ <emulator>/usr/bin/qemu-system-mipsel</emulator>
+ <machine maxCpus='16'>malta</machine>
+ <machine maxCpus='1'>mipssim</machine>
+ <machine maxCpus='1'>magnum</machine>
+ <machine maxCpus='1'>pica61</machine>
+ <machine maxCpus='1'>mips</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <deviceboot/>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='mips64'>
+ <wordsize>64</wordsize>
+ <emulator>/usr/bin/qemu-system-mips64</emulator>
+ <machine maxCpus='16'>malta</machine>
+ <machine maxCpus='1'>mipssim</machine>
+ <machine maxCpus='1'>magnum</machine>
+ <machine maxCpus='1'>mips</machine>
+ <machine maxCpus='1'>pica61</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <deviceboot/>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='mips64el'>
+ <wordsize>64</wordsize>
+ <emulator>/usr/bin/qemu-system-mips64el</emulator>
+ <machine maxCpus='16'>malta</machine>
+ <machine maxCpus='1'>fulong2e</machine>
+ <machine maxCpus='1'>magnum</machine>
+ <machine maxCpus='1'>mipssim</machine>
+ <machine maxCpus='1'>mips</machine>
+ <machine maxCpus='1'>pica61</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <deviceboot/>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='s390x'>
+ <wordsize>64</wordsize>
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
+ <machine canonical='s390-virtio' maxCpus='255'>s390</machine>
+ <machine canonical='s390-ccw-virtio' maxCpus='255'>s390-ccw</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <cpuselection/>
+ <deviceboot/>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='sh4'>
+ <wordsize>32</wordsize>
+ <emulator>/usr/bin/qemu-system-sh4</emulator>
+ <machine maxCpus='1'>shix</machine>
+ <machine maxCpus='1'>r2d</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <deviceboot/>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='sh4eb'>
+ <wordsize>64</wordsize>
+ <emulator>/usr/bin/qemu-system-sh4eb</emulator>
+ <machine maxCpus='1'>shix</machine>
+ <machine maxCpus='1'>r2d</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <deviceboot/>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='unicore32'>
+ <wordsize>32</wordsize>
+ <emulator>/usr/bin/qemu-system-unicore32</emulator>
+ <machine maxCpus='1'>puv3</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='x86_64'>
+ <wordsize>64</wordsize>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <machine canonical='pc-i440fx-2.0' maxCpus='255'>pc</machine>
+ <machine maxCpus='255'>pc-1.3</machine>
+ <machine maxCpus='255'>pc-0.12</machine>
+ <machine maxCpus='255'>pc-q35-1.6</machine>
+ <machine maxCpus='255'>pc-q35-1.5</machine>
+ <machine maxCpus='255'>pc-i440fx-1.6</machine>
+ <machine maxCpus='255'>pc-i440fx-1.7</machine>
+ <machine maxCpus='255'>pc-0.11</machine>
+ <machine maxCpus='255'>pc-1.2</machine>
+ <machine maxCpus='255'>pc-0.10</machine>
+ <machine maxCpus='1'>isapc</machine>
+ <machine maxCpus='255'>pc-q35-1.4</machine>
+ <machine maxCpus='255'>pc-0.15</machine>
+ <machine maxCpus='255'>pc-0.14</machine>
+ <machine maxCpus='255'>pc-i440fx-1.5</machine>
+ <machine maxCpus='255'>pc-i440fx-1.4</machine>
+ <machine canonical='pc-q35-2.0' maxCpus='255'>q35</machine>
+ <machine maxCpus='255'>pc-1.1</machine>
+ <machine maxCpus='255'>pc-q35-1.7</machine>
+ <machine maxCpus='255'>pc-1.0</machine>
+ <machine maxCpus='255'>pc-0.13</machine>
+ <domain type='qemu'>
+ </domain>
+ <domain type='kvm'>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <machine canonical='pc-i440fx-rhel7.1.0' maxCpus='240'>pc</machine>
+ <machine maxCpus='240'>rhel6.6.0</machine>
+ <machine maxCpus='240'>pc-q35-rhel7.0.0</machine>
+ <machine maxCpus='240'>rhel6.4.0</machine>
+ <machine canonical='pc-q35-rhel7.1.0' maxCpus='240'>q35</machine>
+ <machine maxCpus='240'>pc-i440fx-rhel7.0.0</machine>
+ <machine maxCpus='240'>rhel6.2.0</machine>
+ <machine maxCpus='240'>rhel6.1.0</machine>
+ <machine maxCpus='240'>rhel6.5.0</machine>
+ <machine maxCpus='240'>rhel6.0.0</machine>
+ <machine maxCpus='240'>rhel6.3.0</machine>
+ </domain>
+ </arch>
+ <features>
+ <cpuselection/>
+ <deviceboot/>
+ <disksnapshot default='on' toggle='no'/>
+ <acpi default='on' toggle='yes'/>
+ <apic default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='xtensa'>
+ <wordsize>32</wordsize>
+ <emulator>/usr/bin/qemu-system-xtensa</emulator>
+ <machine maxCpus='4'>sim</machine>
+ <machine maxCpus='4'>lx60</machine>
+ <machine maxCpus='4'>kc705</machine>
+ <machine maxCpus='4'>ml605</machine>
+ <machine maxCpus='4'>lx200</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+ <guest>
+ <os_type>hvm</os_type>
+ <arch name='xtensaeb'>
+ <wordsize>32</wordsize>
+ <emulator>/usr/bin/qemu-system-xtensaeb</emulator>
+ <machine maxCpus='4'>sim</machine>
+ <machine maxCpus='4'>kc705</machine>
+ <machine maxCpus='4'>ml605</machine>
+ <machine maxCpus='4'>lx200</machine>
+ <machine maxCpus='4'>lx60</machine>
+ <domain type='qemu'>
+ </domain>
+ </arch>
+ <features>
+ <disksnapshot default='on' toggle='no'/>
+ </features>
+ </guest>
+
+</capabilities>
+
+
diff --git a/vdsm/caps.py b/vdsm/caps.py
index 89c96ba..c3d7ee8 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -381,25 +381,56 @@
return AutoNumaBalancingStatus.UNKNOWN
+def _getEmulatedMachinesFromNode(node):
+ # We have to make sure to inspect 'canonical' attribute where
+ # libvirt puts the real machine name. Relevant bug:
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1229666
+ return list(set((itertools.chain.from_iterable(
+ (
+ (m.text, m.get('canonical'))
+ if m.get('canonical') else
+ (m.text,)
+ )
+ for m in node.iterfind('machine')))))
+
+
+def _getAllEmulatedMachinesFromCaps(arch, caps):
+ machines = {}
+
+ for archTag in caps.iter(tag='arch'):
+ if archTag.get('name') == arch:
+ emuTag = archTag.find('emulator')
+
+ for domTag in archTag.iterfind('domain'):
+ domEmuTag = domTag.find('emulator')
+ domMachines = (_getEmulatedMachinesFromNode(domTag) or
+ _getEmulatedMachinesFromNode(archTag))
+
+ machines[emuTag.text] = _getEmulatedMachinesFromNode(archTag)
+ if domEmuTag is not None:
+ machines[domEmuTag.text] = domMachines
+
+ return machines
+
+
+def _pickEmulatedMachines(machines):
+ for desired in ('qemu-kvm', 'qemu-system-x86_64',): # FIXME: ppc64le?
+ for candidate in machines.keys():
+ if desired in candidate:
+ return machines[candidate]
+
+ return []
+
+
@utils.memoized
def _getEmulatedMachines(arch, capabilities=None):
if capabilities is None:
capabilities = _getCapsXMLStr()
caps = ET.fromstring(capabilities)
- for archTag in caps.iter(tag='arch'):
- if archTag.get('name') == arch:
- # We have to make sure to inspect 'canonical' attribute where
- # libvirt puts the real machine name. Relevant bug:
- # https://bugzilla.redhat.com/show_bug.cgi?id=1229666
- return list(set((itertools.chain.from_iterable(
- (
- (m.text, m.get('canonical')) if
- m.get('canonical') else (m.text,)
- )
- for m in archTag.iterfind('machine')))))
+ machines = _getAllEmulatedMachinesFromCaps(arch, caps)
- return []
+ return _pickEmulatedMachines(machines)
def _getAllCpuModels(capfile=CPU_MAP_FILE, arch=None):
--
To view, visit https://gerrit.ovirt.org/45257
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4deebbc90bf1cec53fc40bc6a35c6ada933296c3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
8 years, 8 months
Change in vdsm[master]: hsm: Reformat device info dict
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: hsm: Reformat device info dict
......................................................................
hsm: Reformat device info dict
Reformat device info dict in getDeviceList using one item per line and
sorted. This make it easier to search and modify the code and creates
nicer diffs.
Change-Id: I0907e3c5cf27959e0989903162cf16c9add0406d
Signed-off-by: Nir Soffer <nirsof(a)gmail.com>
---
M vdsm/storage/hsm.py
1 file changed, 16 insertions(+), 12 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/45822/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 1b8c064..d3405aa 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -2024,18 +2024,22 @@
pvsize = ""
vguuid = ""
- devInfo = {'GUID': dev.get("guid", ""), 'pvUUID': pvuuid,
- 'pvsize': str(pvsize),
- 'vgUUID': vguuid, 'vendorID': dev.get("vendor", ""),
- 'productID': dev.get("product", ""),
- 'fwrev': dev.get("fwrev", ""),
- "serial": dev.get("serial", ""),
- 'capacity': dev.get("capacity", "0"),
- 'devtype': dev.get("devtype", ""),
- 'pathstatus': dev.get("paths", []),
- 'pathlist': dev.get("connections", []),
- 'logicalblocksize': dev.get("logicalblocksize", ""),
- 'physicalblocksize': dev.get("physicalblocksize", "")}
+ devInfo = {
+ "serial": dev.get("serial", ""),
+ 'GUID': dev.get("guid", ""),
+ 'capacity': dev.get("capacity", "0"),
+ 'devtype': dev.get("devtype", ""),
+ 'fwrev': dev.get("fwrev", ""),
+ 'logicalblocksize': dev.get("logicalblocksize", ""),
+ 'pathlist': dev.get("connections", []),
+ 'pathstatus': dev.get("paths", []),
+ 'physicalblocksize': dev.get("physicalblocksize", ""),
+ 'productID': dev.get("product", ""),
+ 'pvUUID': pvuuid,
+ 'pvsize': str(pvsize),
+ 'vendorID': dev.get("vendor", ""),
+ 'vgUUID': vguuid,
+ }
if not checkStatus:
devInfo["status"] = "unknown"
devices.append(devInfo)
--
To view, visit https://gerrit.ovirt.org/45822
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0907e3c5cf27959e0989903162cf16c9add0406d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
8 years, 8 months
Change in vdsm[master]: scheduler: use single instance
by Piotr Kliczewski
Piotr Kliczewski has uploaded a new change for review.
Change subject: scheduler: use single instance
......................................................................
scheduler: use single instance
We used to have one instance of a scheduler used for periodic
operations. With this patch we prepare code for using single scheduler
in more places like jsonrpc server.
Change-Id: If83eded458f8304d802fcd75839e7a916146918b
Signed-off-by: pkliczewski <piotr.kliczewski(a)gmail.com>
---
M vdsm/clientIF.py
M vdsm/vdsm
M vdsm/virt/periodic.py
3 files changed, 67 insertions(+), 60 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/43825/1
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 44a0f96..e12aca7 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -40,6 +40,7 @@
from vdsm import sslutils
from vdsm import libvirtconnection
from vdsm import constants
+from vdsm import schedule
from vdsm import utils
import caps
import blkid
@@ -95,6 +96,8 @@
self.bindings = {}
self._broker_client = None
self._subscriptions = defaultdict(list)
+ self._scheduler = schedule.Scheduler(name="periodic.Scheduler",
+ clock=utils.monotonic_time)
if _glusterEnabled:
self.gluster = gapi.GlusterApi(self, log)
else:
@@ -141,6 +144,10 @@
@property
def ready(self):
return (self.irs is None or self.irs.ready) and not self._recovery
+
+ @property
+ def scheduler(self):
+ return self._scheduler
def notify(self, event_id, **kwargs):
"""
@@ -280,6 +287,7 @@
secret.clear()
self.channelListener.stop()
self._hostStats.stop()
+ self._scheduler.stop()
if self.irs:
return self.irs.prepareForShutdown()
else:
@@ -288,6 +296,8 @@
self._shutdownSemaphore.release()
def start(self):
+ self._scheduler.start()
+
for binding in self.bindings.values():
binding.start()
self.thread = threading.Thread(target=self._reactor.process_requests,
diff --git a/vdsm/vdsm b/vdsm/vdsm
index 67f21a4..ceef742 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -95,14 +95,15 @@
install_manhole({'irs': irs, 'cif': cif})
cif.start()
- periodic.start(cif)
+ runner = periodic.PeriodicOperationRunner()
+ runner.start(cif)
try:
while running[0]:
sigutils.wait_for_signal()
profile.stop()
finally:
- periodic.stop()
+ runner.stop()
cif.prepareForShutdown()
diff --git a/vdsm/virt/periodic.py b/vdsm/virt/periodic.py
index b023976..ff0a379 100644
--- a/vdsm/virt/periodic.py
+++ b/vdsm/virt/periodic.py
@@ -27,9 +27,7 @@
from vdsm import executor
from vdsm import libvirtconnection
-from vdsm import schedule
from vdsm.config import config
-from vdsm.utils import monotonic_time
from . import sampling
@@ -41,13 +39,6 @@
_TASKS = _WORKERS * _TASK_PER_WORKER
-_scheduler = schedule.Scheduler(name="periodic.Scheduler",
- clock=monotonic_time)
-
-_executor = executor.Executor(name="periodic.Executor",
- workers_count=_WORKERS,
- max_tasks=_TASKS,
- scheduler=_scheduler)
_operations = []
@@ -58,63 +49,69 @@
return interval / 2.
-def start(cif):
- global _operations
+class PeriodicOperationRunner(object):
- _scheduler.start()
- _executor.start()
+ def start(self, cif):
+ global _operations
+ self._scheduler = cif.scheduler
- def per_vm_operation(func, period):
- disp = VmDispatcher(
- cif.getVMs, _executor, func, _timeout_from(period))
- return Operation(disp, period)
+ self._executor = executor.Executor(name="periodic.Executor",
+ workers_count=_WORKERS,
+ max_tasks=_TASKS,
+ scheduler=self._scheduler)
+ self._executor.start()
- _operations = [
- # needs dispatching becuse updating the volume stats needs the
- # access the storage, thus can block.
- per_vm_operation(
- UpdateVolumes,
- config.getint('irs', 'vol_size_sample_interval')),
+ def per_vm_operation(func, period):
+ disp = VmDispatcher(
+ cif.getVMs, self._executor, func, _timeout_from(period))
+ return Operation(disp, period, self._scheduler, self._executor)
- # needs dispatching becuse access FS and libvirt data
- per_vm_operation(
- NumaInfoMonitor,
- config.getint('vars', 'vm_sample_numa_interval')),
+ _operations = [
+ # needs dispatching becuse updating the volume stats needs the
+ # access the storage, thus can block.
+ per_vm_operation(
+ UpdateVolumes,
+ config.getint('irs', 'vol_size_sample_interval')),
- # Job monitoring need QEMU monitor access.
- per_vm_operation(
- BlockjobMonitor,
- config.getint('vars', 'vm_sample_jobs_interval')),
+ # needs dispatching becuse access FS and libvirt data
+ per_vm_operation(
+ NumaInfoMonitor,
+ config.getint('vars', 'vm_sample_numa_interval')),
- # libvirt sampling using bulk stats can block, but unresponsive
- # domains are handled inside VMBulkSampler for performance reasons;
- # thus, does not need dispatching.
- Operation(
- sampling.VMBulkSampler(
- libvirtconnection.get(cif),
- cif.getVMs,
- sampling.stats_cache),
- config.getint('vars', 'vm_sample_interval')),
+ # Job monitoring need QEMU monitor access.
+ per_vm_operation(
+ BlockjobMonitor,
+ config.getint('vars', 'vm_sample_jobs_interval')),
- # we do this only until we get high water mark notifications
- # from qemu. Access storage and/or qemu monitor, so can block,
- # thus we need dispatching.
- per_vm_operation(
- DriveWatermarkMonitor,
- config.getint('vars', 'vm_watermark_interval'))
+ # libvirt sampling using bulk stats can block, but unresponsive
+ # domains are handled inside VMBulkSampler for performance reasons;
+ # thus, does not need dispatching.
+ Operation(
+ sampling.VMBulkSampler(
+ libvirtconnection.get(cif),
+ cif.getVMs,
+ sampling.stats_cache),
+ config.getint('vars', 'vm_sample_interval'),
+ self._scheduler,
+ self._executor),
- ]
+ # we do this only until we get high water mark notifications
+ # from qemu. Access storage and/or qemu monitor, so can block,
+ # thus we need dispatching.
+ per_vm_operation(
+ DriveWatermarkMonitor,
+ config.getint('vars', 'vm_watermark_interval'))
- for op in _operations:
- op.start()
+ ]
+ for op in _operations:
+ op.start()
-def stop():
- for op in _operations:
- op.stop()
+ def stop(self):
+ for op in _operations:
+ op.stop()
- _executor.stop(wait=False)
- _scheduler.stop(wait=False)
+ self._executor.stop(wait=False)
class Operation(object):
@@ -128,8 +125,7 @@
_log = logging.getLogger("virt.periodic.Operation")
- def __init__(self, func, period, timeout=0,
- scheduler=None, executor=None):
+ def __init__(self, func, period, scheduler, executor, timeout=0):
"""
parameters:
@@ -144,8 +140,8 @@
self._func = func
self._period = period
self._timeout = _timeout_from(period) if timeout == 0 else timeout
- self._scheduler = _scheduler if scheduler is None else scheduler
- self._executor = _executor if executor is None else executor
+ self._scheduler = scheduler
+ self._executor = executor
self._lock = threading.Lock()
self._running = False
self._call = None
--
To view, visit https://gerrit.ovirt.org/43825
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If83eded458f8304d802fcd75839e7a916146918b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
8 years, 8 months