Change in vdsm[master]: utils: Use ovirt node for persist and unpersist files
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: utils: Use ovirt node for persist and unpersist files
......................................................................
utils: Use ovirt node for persist and unpersist files
Change-Id: Ifaf19e5f8f5beca38d34a606c3eb370385dc206d
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M lib/vdsm/utils.py
1 file changed, 19 insertions(+), 15 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/84/31584/1
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index e88007c..b02daa8 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -143,6 +143,18 @@
raise
+def persistFile(name):
+ if isOvirtNode():
+ from ovirt.node.utils.fs import Config as NodeCfg
+ NodeCfg().persist(name)
+
+
+def unpersistFile(name):
+ if isOvirtNode():
+ from ovirt.node.utils.fs import Config as NodeCfg
+ NodeCfg().unpersist(name)
+
+
def rotateFiles(directory, prefixName, gen, cp=False, persist=False):
logging.debug("dir: %s, prefixName: %s, versions: %s" %
(directory, prefixName, gen))
@@ -171,37 +183,29 @@
for key in keys:
oldName = os.path.join(directory, fd[key]['old'])
newName = os.path.join(directory, fd[key]['new'])
- if isOvirtNode() and persist and not cp:
+ if persist and not cp:
try:
- execCmd([constants.EXT_UNPERSIST, oldName],
- sudo=True)
- execCmd([constants.EXT_UNPERSIST, newName],
- sudo=True)
+ unpersistFile(oldName)
+ unpersistFile(newName)
except:
pass
try:
if cp:
execCmd([constants.EXT_CP, oldName, newName], sudo=True)
- if (isOvirtNode() and
- persist and not os.path.exists(newName)):
- execCmd([constants.EXT_PERSIST, newName],
- sudo=True)
+ if (persist and not os.path.exists(newName)):
+ persistFile(newName)
else:
os.rename(oldName, newName)
except:
pass
- if isOvirtNode() and persist and not cp:
+ if persist and not cp:
try:
+ persistFile(newName)
execCmd([constants.EXT_PERSIST, newName],
sudo=True)
except:
pass
-
-
-def persistFile(name):
- if isOvirtNode():
- execCmd([constants.EXT_PERSIST, name], sudo=True)
def _parseMemInfo(lines):
--
To view, visit http://gerrit.ovirt.org/31584
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifaf19e5f8f5beca38d34a606c3eb370385dc206d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: Revised the format of output from the vdsm-tool vdsm-id comm...
by mtayer@redhat.com
mooli tayer has posted comments on this change.
Change subject: Revised the format of output from the vdsm-tool vdsm-id command.
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit http://gerrit.ovirt.org/34583
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I7379e969881931aaa4745dedf85ddfb61487f4a4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Andrew Dahms <andrewjdahms(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
9 years, 5 months
Change in vdsm[master]: Revised the format of output from the vdsm-tool vdsm-id comm...
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: Revised the format of output from the vdsm-tool vdsm-id command.
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit http://gerrit.ovirt.org/34583
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I7379e969881931aaa4745dedf85ddfb61487f4a4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Andrew Dahms <andrewjdahms(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
9 years, 5 months
Change in vdsm[ovirt-3.5.0]: Adding the possibility to skip checks on rpmbuild
by ybronhei@redhat.com
Hello Douglas Schilling Landgraf, David Caro, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/34773
to review the following change.
Change subject: Adding the possibility to skip checks on rpmbuild
......................................................................
Adding the possibility to skip checks on rpmbuild
This way you can build the rpms skipping the tests just defining the variable
with_check to 0 when running rpmbuild, also skipping checks by default when
building on el* based hosts
Change-Id: I674ae8f8e5ff8b21a0175197bd42e61af6075afd
Signed-off-by: David Caro <dcaroest(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/29213
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
Reviewed-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/34766
Tested-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 8 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/73/34773/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 4f822e4..49a7e27 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -20,6 +20,11 @@
# touch configure.ac or Makefile.am.
%{!?enable_autotools:%define enable_autotools 0}
+# Skips check since rhel default repos lack pep8 and pyflakes
+%if ! 0%{?rhel}
+%global with_check 1
+%endif
+
# Required paths
%if 0%{?fedora} >= 18
%global _polkitdir %{_datadir}/polkit-1/rules.d
@@ -107,7 +112,7 @@
BuildRequires: libtool
%endif
-%if !0%{?rhel}
+%if 0%{?with_check}
BuildRequires: pyflakes
BuildRequires: python-pep8
%endif
@@ -724,7 +729,9 @@
%endif
%check
+%if 0%{?with_check}
make check
+%endif
%clean
rm -rf %{buildroot}
--
To view, visit http://gerrit.ovirt.org/34773
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I674ae8f8e5ff8b21a0175197bd42e61af6075afd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5.0
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: David Caro <dcaroest(a)redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland(a)redhat.com>
9 years, 5 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, 5 months
Change in vdsm[master]: utils: Add logs to rotateFiles
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: utils: Add logs to rotateFiles
......................................................................
utils: Add logs to rotateFiles
Change-Id: If4636d54bb39db02301e2f528c9ca15f13472eaf
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M lib/vdsm/utils.py
1 file changed, 10 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/05/32605/1
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index 3a83300..54fcfa0 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -156,6 +156,11 @@
def rotateFiles(directory, prefixName, gen, cp=False, persist=False):
+ '''
+ gen: the max number of files rotated and saved under directory at a point
+ in time
+ cp : determines if rotate is done with root permissions
+ '''
logging.debug("dir: %s, prefixName: %s, versions: %s" %
(directory, prefixName, gen))
gen = int(gen)
@@ -188,7 +193,8 @@
unpersistFile(oldName)
unpersistFile(newName)
except:
- pass
+ logging.warning("Failed to unpersist files: %s, %s",
+ oldName, newName)
try:
if cp:
execCmd([constants.EXT_CP, oldName, newName], sudo=True)
@@ -198,14 +204,13 @@
else:
os.rename(oldName, newName)
except:
- pass
+ logging.warning("Failed to rotate file: %s to: %s",
+ oldName, newName)
if persist and not cp:
try:
persistFile(newName)
- execCmd([constants.EXT_PERSIST, newName],
- sudo=True)
except:
- pass
+ logging.warning("Failed to persist file: %s" % newName)
def _parseMemInfo(lines):
--
To view, visit http://gerrit.ovirt.org/32605
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If4636d54bb39db02301e2f528c9ca15f13472eaf
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: hooks: Add a hook to configure IPv6 networking through custo...
by osvoboda@redhat.com
Ondřej Svoboda has uploaded a new change for review.
Change subject: hooks: Add a hook to configure IPv6 networking through custom properties
......................................................................
hooks: Add a hook to configure IPv6 networking through custom properties
The hook currently forwards 'ipv6addr' and 'ipv6gateway' properties
the API. More options will probably follow ('ipv6autoconf' and 'dhcpv6').
Change-Id: Ia0e427b182a1742999eeb14e004209b511668ba2
Signed-off-by: Ondřej Svoboda <osvoboda(a)redhat.com>
---
M debian/Makefile.am
A debian/vdsm-hook-ipv6.docs
A debian/vdsm-hook-ipv6.install
M vdsm.spec.in
M vdsm_hooks/Makefile.am
A vdsm_hooks/ipv6/Makefile.am
A vdsm_hooks/ipv6/README
A vdsm_hooks/ipv6/ipv6.py
8 files changed, 110 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/34571/1
diff --git a/debian/Makefile.am b/debian/Makefile.am
index 00b0d33..770a4c4 100644
--- a/debian/Makefile.am
+++ b/debian/Makefile.am
@@ -55,6 +55,8 @@
vdsm-hook-hostusb.install \
vdsm-hook-hugepages.docs \
vdsm-hook-hugepages.install \
+ vdsm-hook-ipv6.docs \
+ vdsm-hook-ipv6.install \
vdsm-hook-isolatedprivatevlan.docs \
vdsm-hook-isolatedprivatevlan.install \
vdsm-hook-macspoof.docs \
diff --git a/debian/vdsm-hook-ipv6.docs b/debian/vdsm-hook-ipv6.docs
new file mode 100644
index 0000000..5ecd9c6
--- /dev/null
+++ b/debian/vdsm-hook-ipv6.docs
@@ -0,0 +1 @@
+COPYING
diff --git a/debian/vdsm-hook-ipv6.install b/debian/vdsm-hook-ipv6.install
new file mode 100644
index 0000000..8df9886
--- /dev/null
+++ b/debian/vdsm-hook-ipv6.install
@@ -0,0 +1 @@
+usr/libexec/vdsm/hooks/before_network_setup/10_ipv6
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 4b49a8e..f4c7772 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -631,6 +631,15 @@
%description hook-vmdisk
Hook adds additional disk image for a VM (raw or qcow2)
+%package hook-ipv6
+Summary: Set IPv6 configuration through custom network properties
+BuildArch: noarch
+Requires: %{name} = %{version}-%{release}
+
+%description hook-ipv6
+VDSM hook used for applying IPv6 configuration through custom network
+properties
+
%if 0%{?with_gluster}
%package gluster
Summary: Gluster Plugin for VDSM
@@ -1384,6 +1393,10 @@
%{_libexecdir}/%{vdsm_name}/hooks/before_vm_migrate_destination/50_hugepages
%{_libexecdir}/%{vdsm_name}/hooks/after_vm_destroy/50_hugepages
+%files hook-ipv6
+%defattr(-, root, root, -)
+%{_libexecdir}/%{vdsm_name}/hooks/before_network_setup/10_ipv6
+
%files hook-isolatedprivatevlan
%defattr(-, root, root, -)
%{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/50_isolatedprivatevlan
diff --git a/vdsm_hooks/Makefile.am b/vdsm_hooks/Makefile.am
index c68076e..0add342 100644
--- a/vdsm_hooks/Makefile.am
+++ b/vdsm_hooks/Makefile.am
@@ -18,7 +18,7 @@
# Refer to the README and COPYING files for full details of the license
#
-SUBDIRS = ethtool_options faqemu vhostmd qemucmdline openstacknet macspoof
+SUBDIRS = ethtool_options faqemu ipv6 macspoof openstacknet qemucmdline vhostmd
include $(top_srcdir)/build-aux/Makefile.subs
diff --git a/vdsm_hooks/ipv6/Makefile.am b/vdsm_hooks/ipv6/Makefile.am
new file mode 100644
index 0000000..53d5c65
--- /dev/null
+++ b/vdsm_hooks/ipv6/Makefile.am
@@ -0,0 +1,30 @@
+#
+# 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
+#
+
+EXTRA_DIST = \
+ ipv6.py
+
+install-data-local:
+ $(MKDIR_P) $(DESTDIR)$(vdsmhooksdir)/before_network_setup
+ $(INSTALL_SCRIPT) $(srcdir)/ipv6.py \
+ $(DESTDIR)$(vdsmhooksdir)/before_network_setup/10_ipv6
+
+uninstall-local:
+ $(RM) $(DESTDIR)$(vdsmhooksdir)/before_network_setup/10_ipv6
diff --git a/vdsm_hooks/ipv6/README b/vdsm_hooks/ipv6/README
new file mode 100644
index 0000000..67d23cc
--- /dev/null
+++ b/vdsm_hooks/ipv6/README
@@ -0,0 +1,12 @@
+ipv6 vdsm hook
+=================================
+This hook allows the user to pass IPv6 configuration for networks to VDSM.
+
+Requirements:
+* oVirt-3.5 (?started supporting custom properties?)
+
+Usage:
+In the oVirt UI edit custom network properties and, for the keys 'ipv6addr'
+and 'ipv6gateway'
+set the command line parameters that one would pass to the *** command
+line application.
diff --git a/vdsm_hooks/ipv6/ipv6.py b/vdsm_hooks/ipv6/ipv6.py
new file mode 100644
index 0000000..82af008
--- /dev/null
+++ b/vdsm_hooks/ipv6/ipv6.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python
+# 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
+#
+import hooking
+import traceback
+
+
+def main():
+ """Forward IPv6 configuration from the network 'custom' properties
+ to VDSM API."""
+ setup_nets_config = hooking.read_json()
+ for network, attrs in setup_nets_config['request']['networks'].items():
+ if 'remove' in attrs:
+ continue
+ elif 'custom' in attrs:
+ _process_network(network, attrs)
+
+
+def _process_network(network, attrs):
+ """Add an IPv6 address and a gateway to the network."""
+ ipv6addr = attrs['custom'].get('ipv6addr')
+ if ipv6addr is not None:
+ attrs['ipv6addr'] = ipv6addr
+ ipv6gateway = attrs['custom'].get('ipv6gateway')
+ if ipv6gateway is not None:
+ attrs['ipv6gateway'] = ipv6gateway
+
+
+if __name__ == '__main__':
+ try:
+ main()
+ except:
+ hooking.exit_hook('ipv6 hook: [unexpected error]: %s\n' %
+ traceback.format_exc())
--
To view, visit http://gerrit.ovirt.org/34571
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia0e427b182a1742999eeb14e004209b511668ba2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
9 years, 5 months
Change in vdsm[ovirt-3.5]: vm, guestagent: return hash should include also the disk map...
by laravot@redhat.com
Liron Aravot has uploaded a new change for review.
Change subject: vm, guestagent: return hash should include also the disk mapping
......................................................................
vm, guestagent: return hash should include also the disk mapping
Change-Id: I148196ccf353613f9cffed7753e7100bd1dd30de
Signed-off-by: Liron Aravot <laravot(a)redhat.com>
---
M tests/vmTests.py
M vdsm/virt/guestagent.py
M vdsm/virt/vm.py
3 files changed, 15 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/98/33198/1
diff --git a/tests/vmTests.py b/tests/vmTests.py
index a89a8d3..ee0fd38 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -896,6 +896,7 @@
class FakeGuestAgent(object):
def __init__(self):
self.guestDiskMapping = {}
+ self.diskMappingHash = 0
def getGuestInfo(self):
return {
@@ -1140,6 +1141,13 @@
self.assertIn(statsDev['type'], confDev['device'])
self.assertIn('port', statsDev)
+ def testDiskMappingHashInStatsHash(self):
+ with FakeVM(self.VM_PARAMS) as fake:
+ res = fake.getStats()
+ fake.guestAgent.diskMappingHash += 1
+ self.assertNotEquals(res['hash'],
+ fake.getStats()['hash'])
+
class TestLibVirtCallbacks(TestCaseBase):
FAKE_ERROR = 'EFAKERROR'
diff --git a/vdsm/virt/guestagent.py b/vdsm/virt/guestagent.py
index 1435c57..3bab490 100644
--- a/vdsm/virt/guestagent.py
+++ b/vdsm/virt/guestagent.py
@@ -121,6 +121,7 @@
self._stopped = True
self.guestStatus = None
self.guestDiskMapping = {}
+ self.diskMappingHash = 0
self.guestInfo = {
'username': user,
'memUsage': 0,
@@ -305,6 +306,8 @@
disks.append(disk)
self.guestInfo['disksUsage'] = disks
self.guestDiskMapping = args.get('mapping', {})
+ self.diskMappingHash = hash(json.dumps(self.guestDiskMapping,
+ sort_keys=True))
elif message == 'number-of-cpus':
self.guestInfo['guestCPUCount'] = int(args['count'])
else:
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 548ce18..f056000 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1927,7 +1927,7 @@
self._guestSocketFile = self._makeChannelPath(_VMCHANNEL_DEVICE_NAME)
self._qemuguestSocketFile = self._makeChannelPath(_QEMU_GA_DEVICE_NAME)
self._lastXMLDesc = '<domain><uuid>%s</uuid></domain>' % self.id
- self._devXmlHash = '0'
+ self._devXmlHash = 0
self._released = False
self._releaseLock = threading.Lock()
self.saveState()
@@ -2945,7 +2945,8 @@
exc_info=True)
stats.update(self._getGraphicsStats())
- stats['hash'] = self._devXmlHash
+ stats['hash'] = str(hash((self._devXmlHash,
+ self.guestAgent.diskMappingHash)))
if self._watchdogEvent:
stats['watchdogEvent'] = self._watchdogEvent
return stats
@@ -4813,7 +4814,7 @@
self._lastXMLDesc = self._dom.XMLDesc(0)
devxml = _domParseStr(self._lastXMLDesc).childNodes[0]. \
getElementsByTagName('devices')[0]
- self._devXmlHash = str(hash(devxml.toxml()))
+ self._devXmlHash = hash(devxml.toxml())
return self._lastXMLDesc
--
To view, visit http://gerrit.ovirt.org/33198
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I148196ccf353613f9cffed7753e7100bd1dd30de
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Liron Aravot <laravot(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: oop: fix tests
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: oop: fix tests
......................................................................
oop: fix tests
Change-Id: I9dfd7d2815d70566fc3a95760058e45e9dcfeab3
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M tests/outOfProcessTests.py
1 file changed, 12 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/65/34765/1
diff --git a/tests/outOfProcessTests.py b/tests/outOfProcessTests.py
index 94918a0..c9682ed 100644
--- a/tests/outOfProcessTests.py
+++ b/tests/outOfProcessTests.py
@@ -20,6 +20,7 @@
from testlib import VdsmTestCase as TestCaseBase
import storage.outOfProcess as oop
+import logging
import os
import tempfile
import time
@@ -30,11 +31,14 @@
class OopWrapperTests(TestCaseBase):
- IOPROC_IDLE_TIME = config.getint("irs", "max_ioprocess_idle_time")
def setUp(self):
oop.setDefaultImpl(oop.IOPROC)
self.pool = oop.getGlobalProcPool()
+
+ def tearDown(self):
+ self.pool._ioproc.close()
+ oop._refProcPool = {}
def testSamePoolName(self):
poolA = "A"
@@ -59,23 +63,25 @@
self.assertNotEquals(pids[0], pids[1])
def testAmountOfInstancesPerPoolName(self):
+ import gc
+ oop.IOPROC_IDLE_TIME = 5
poolA = "A"
poolB = "B"
wrapper = ref(oop.getProcessPool(poolA))
ioproc = ref(oop.getProcessPool(poolA)._ioproc)
oop.getProcessPool(poolA)
- time.sleep(self.IOPROC_IDLE_TIME + 1)
+ time.sleep(oop.IOPROC_IDLE_TIME + 1)
oop.getProcessPool(poolB)
self.assertEquals(wrapper(), None)
- import gc
gc.collect()
time.sleep(1)
gc.collect()
- print "GARBAGE: ", gc.garbage
+ logging.info("GARBAGE: %s", gc.garbage)
refs = gc.get_referrers(ioproc())
- print refs
- print gc.get_referrers(*refs)
+ logging.info(refs)
+ logging.info(gc.get_referrers(*refs))
self.assertEquals(ioproc(), None)
+ oop.IOPROC_IDLE_TIME = config.getint("irs", "max_ioprocess_idle_time")
def testEcho(self):
data = """Censorship always defeats it own purpose, for it creates in
--
To view, visit http://gerrit.ovirt.org/34765
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9dfd7d2815d70566fc3a95760058e45e9dcfeab3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: tests: add unit tests for IOProcess per SD
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: tests: add unit tests for IOProcess per SD
......................................................................
tests: add unit tests for IOProcess per SD
Change-Id: I904a33e45ad935856517b70f6bd3e6e5d56ca187
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M tests/outOfProcessTests.py
1 file changed, 48 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/78/34578/1
diff --git a/tests/outOfProcessTests.py b/tests/outOfProcessTests.py
index e49930f..94918a0 100644
--- a/tests/outOfProcessTests.py
+++ b/tests/outOfProcessTests.py
@@ -22,13 +22,61 @@
import storage.outOfProcess as oop
import os
import tempfile
+import time
+import re
+from weakref import ref
+
+from vdsm.config import config
class OopWrapperTests(TestCaseBase):
+ IOPROC_IDLE_TIME = config.getint("irs", "max_ioprocess_idle_time")
+
def setUp(self):
oop.setDefaultImpl(oop.IOPROC)
self.pool = oop.getGlobalProcPool()
+ def testSamePoolName(self):
+ poolA = "A"
+ pids = []
+ for pool in (poolA, poolA):
+ proc = oop.getProcessPool(pool)._ioproc
+ name = proc._commthread.getName()
+ pids.append(int(re.search(r'\d+', name).group()))
+
+ self.assertEquals(pids[0], pids[1])
+
+ def testDifferentPoolName(self):
+ poolA = "A"
+ poolB = "B"
+ pools = (poolA, poolB)
+ pids = []
+ for pool in pools:
+ proc = oop.getProcessPool(pool)._ioproc
+ name = proc._commthread.name
+ pids.append(int(re.search(r'\d+', name).group()))
+
+ self.assertNotEquals(pids[0], pids[1])
+
+ def testAmountOfInstancesPerPoolName(self):
+ poolA = "A"
+ poolB = "B"
+ wrapper = ref(oop.getProcessPool(poolA))
+ ioproc = ref(oop.getProcessPool(poolA)._ioproc)
+ oop.getProcessPool(poolA)
+ time.sleep(self.IOPROC_IDLE_TIME + 1)
+ oop.getProcessPool(poolB)
+ self.assertEquals(wrapper(), None)
+ import gc
+ gc.collect()
+ time.sleep(1)
+ gc.collect()
+ print "GARBAGE: ", gc.garbage
+ refs = gc.get_referrers(ioproc())
+ print refs
+ print gc.get_referrers(*refs)
+ self.assertEquals(ioproc(), None)
+
def testEcho(self):
data = """Censorship always defeats it own purpose, for it creates in
the end the kind of society that is incapable of exercising
--
To view, visit http://gerrit.ovirt.org/34578
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I904a33e45ad935856517b70f6bd3e6e5d56ca187
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
9 years, 5 months