Change in vdsm[master]: xmlrpc: Parsing error logging enhancement - vdsClient
by ybronhei@redhat.com
Yaniv Bronhaim has posted comments on this change.
Change subject: xmlrpc: Parsing error logging enhancement - vdsClient
......................................................................
Patch Set 4:
(2 comments)
....................................................
File lib/vdsm/vdscli.py.in
Line 40:
Line 41: def __getattr__(self, name):
Line 42: if hasattr(self._transport, name):
Line 43: func = getattr(self._transport, name)
Line 44: if name == 'parse_response':
do you wrap only one function called parse_response?? so modify only the specific function.. why do you need it for each call
Line 45: return lambda *args, **kwargs: self._wrap(name,
Line 46: func, args, kwargs)
Line 47: else:
Line 48: return func
Line 57: except ExpatError as e:
Line 58: sys.stderr.write('Parsing error was thrown during parsing '
Line 59: 'response. Following arguments were passed: ')
Line 60: for arg in enumerate(args):
Line 61: sys.stdout.write(arg[1])
you need to specify "\n" in this usage btw.. not sure if here its needed.
and why did you change this part ? can you add comment what should be settled in arg[1] in this case?
Line 62: raise e
Line 63: return result
Line 64:
Line 65:
--
To view, visit http://gerrit.ovirt.org/20627
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ife29c4f7749b9cd8a4ad892f486d91509e505ae4
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
9 years, 10 months
Change in vdsm[master]: Fix ballooning rules for computing the minimum available memory
by Martin Sivak
Martin Sivák has uploaded a new change for review.
Change subject: Fix ballooning rules for computing the minimum available memory
......................................................................
Fix ballooning rules for computing the minimum available memory
Change-Id: Ie416db6580462bbd16e80bea0a4e339656eccb0f
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1025845
Signed-off-by: Martin Sivak <msivak(a)redhat.com>
---
M vdsm/mom.d/02-balloon.policy
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/49/20849/1
diff --git a/vdsm/mom.d/02-balloon.policy b/vdsm/mom.d/02-balloon.policy
index cc328aa..26c30e2 100644
--- a/vdsm/mom.d/02-balloon.policy
+++ b/vdsm/mom.d/02-balloon.policy
@@ -46,7 +46,7 @@
# Given current conditions, determine the ideal guest memory size
(defvar guest_used_mem (- (guest.StatAvg "balloon_cur")
(guest.StatAvg "mem_unused")))
- (defvar balloon_min (min guest.balloon_min (+ guest_used_mem
+ (defvar balloon_min (max guest.balloon_min (+ guest_used_mem
(* guest_free_percent guest.balloon_cur))))
# But do not change it too fast
(defvar balloon_size (* guest.balloon_cur
@@ -79,7 +79,7 @@
# Minimally, increase so the guest has its desired free memory
(defvar guest_used_mem (- (guest.StatAvg "balloon_cur")
(guest.StatAvg "mem_unused")))
- (defvar balloon_min (min guest.balloon_min (+ guest_used_mem
+ (defvar balloon_min (max guest.balloon_min (+ guest_used_mem
(* guest_free_percent guest.balloon_cur))))
# Otherwise, increase according to the max balloon change
(defvar balloon_size (* guest.balloon_cur
--
To view, visit http://gerrit.ovirt.org/20849
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie416db6580462bbd16e80bea0a4e339656eccb0f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Sivák <msivak(a)redhat.com>
9 years, 10 months
Change in vdsm[master]: xmlrpc: Parsing error logging enhancement - vdsClient
by Jenkins CI RO
oVirt Jenkins CI Server has posted comments on this change.
Change subject: xmlrpc: Parsing error logging enhancement - vdsClient
......................................................................
Patch Set 4:
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/4421/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/5225/ : To avoid overloading the infrastructure, a whitelist for running gerrit triggered jobs has been set in place, if you feel like you should be in it, please contact infra at ovirt dot org.
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/5301/ : To avoid overloading the infrastructure, a whitelist for running gerrit triggered jobs has been set in place, if you feel like you should be in it, please contact infra at ovirt dot org.
--
To view, visit http://gerrit.ovirt.org/20627
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ife29c4f7749b9cd8a4ad892f486d91509e505ae4
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
9 years, 10 months
Change in vdsm[master]: xmlrpc: Parsing error logging enhancement - vdsClient
by ybronhei@redhat.com
Yaniv Bronhaim has posted comments on this change.
Change subject: xmlrpc: Parsing error logging enhancement - vdsClient
......................................................................
Patch Set 3:
(1 comment)
....................................................
File lib/vdsm/vdscli.py.in
Line 40:
Line 41: def __getattr__(self, name):
Line 42: if hasattr(self._transport, name):
Line 43: func = getattr(self._transport, name)
Line 44: return lambda *args, **kwargs: self._wrap(name, func, args, kwargs)
so submit your new version please.
Line 45: raise AttributeError(name)
Line 46:
Line 47: def _wrap(self, name, func, args, kwargs):
Line 48: try:
--
To view, visit http://gerrit.ovirt.org/20627
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ife29c4f7749b9cd8a4ad892f486d91509e505ae4
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
9 years, 10 months
Change in vdsm[master]: [WIP] vm: cleanup of vm.py - removed old api references
by mpoledni@redhat.com
Martin Polednik has uploaded a new change for review.
Change subject: [WIP] vm: cleanup of vm.py - removed old api references
......................................................................
[WIP] vm: cleanup of vm.py
- removed old api references
Change-Id: I2712148b670c9f85beaea40a0b2e870d829b2b4b
Signed-off-by: mpolednik <mpoledni(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 2 insertions(+), 171 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/18047/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index a0b7310..e16a316 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -1811,172 +1811,6 @@
dev['target'] = int(self.conf.get('memSize')) * 1024
return devices
- def buildConfDevices(self):
- """
- Return the "devices" section of this Vm's conf.
- If missing, create it according to old API.
- """
- # For BC we need to save previous behaviour for old type parameters.
- # The new/old type parameter will be distinguished
- # by existence/absence of the 'devices' key
- devices = {}
- # Build devices structure
- if self.conf.get('devices') is None:
- with self._confLock:
- self.conf['devices'] = []
- devices[DISK_DEVICES] = self.getConfDrives()
- devices[NIC_DEVICES] = self.getConfNetworkInterfaces()
- devices[SOUND_DEVICES] = self.getConfSound()
- devices[VIDEO_DEVICES] = self.getConfVideo()
- devices[CONTROLLER_DEVICES] = self.getConfController()
- devices[GENERAL_DEVICES] = []
- devices[BALLOON_DEVICES] = []
- devices[WATCHDOG_DEVICES] = []
- devices[SMARTCARD_DEVICES] = self.getConfSmartcard()
- devices[REDIR_DEVICES] = []
- devices[CONSOLE_DEVICES] = []
- else:
- devices = self.getConfDevices()
-
- # libvirt only support one watchdog device
- if len(devices[WATCHDOG_DEVICES]) > 1:
- raise ValueError("only a single watchdog device is supported")
- if len(devices[WATCHDOG_DEVICES]) == 1:
- if not 'specParams' in devices[WATCHDOG_DEVICES][0]:
- devices[WATCHDOG_DEVICES][0]['specParams'] = {}
- if not 'model' in devices[WATCHDOG_DEVICES][0]['specParams']:
- devices[WATCHDOG_DEVICES][0]['specParams']['model'] = \
- 'i6300esb'
- if not 'action' in devices[WATCHDOG_DEVICES][0]['specParams']:
- devices[WATCHDOG_DEVICES][0]['specParams']['action'] = 'none'
-
- if len(devices[CONSOLE_DEVICES]) > 1:
- raise ValueError("Only a single console device is supported")
-
- # Normalize vdsm images
- for drv in devices[DISK_DEVICES]:
- if isVdsmImage(drv):
- self._normalizeVdsmImg(drv)
-
- # Preserve old behavior. Since libvirt add a memory balloon device
- # to all guests, we need to specifically request not to add it.
- if len(devices[BALLOON_DEVICES]) == 0:
- devices[BALLOON_DEVICES].append({
- 'type': BALLOON_DEVICES,
- 'device': 'memballoon',
- 'specParams': {
- 'model': 'none'}})
-
- return devices
-
- def getConfController(self):
- """
- Normalize controller device.
- """
- controllers = []
- # For now we create by default only 'virtio-serial' controller
- controllers.append({'type': CONTROLLER_DEVICES,
- 'device': 'virtio-serial'})
- return controllers
-
- def getConfVideo(self):
- """
- Normalize video device provided by conf.
- """
- vcards = []
- if self.conf.get('display') == 'vnc':
- devType = 'cirrus'
- elif self.conf.get('display') == 'qxl':
- devType = 'qxl'
-
- monitors = int(self.conf.get('spiceMonitors', '1'))
- vram = '65536' if (monitors <= 2) else '32768'
- for idx in range(monitors):
- vcards.append({'type': VIDEO_DEVICES, 'specParams': {'vram': vram},
- 'device': devType})
-
- return vcards
-
- def getConfSmartcard(self):
- """
- Normalize smartcard device (now there is only one)
- """
- cards = []
- if self.conf.get('smartcard'):
- cards.append({'device': SMARTCARD_DEVICES,
- 'specParams': {'mode': 'passthrough',
- 'type': 'spicevmc'}})
- return cards
-
- def getConfSound(self):
- """
- Normalize sound device provided by conf.
- """
- scards = []
- if self.conf.get('soundDevice'):
- scards.append({'type': SOUND_DEVICES,
- 'device': self.conf.get('soundDevice')})
-
- return scards
-
- def getConfNetworkInterfaces(self):
- """
- Normalize networks interfaces provided by conf.
- """
- nics = []
- macs = self.conf.get('macAddr', '').split(',')
- models = self.conf.get('nicModel', '').split(',')
- bridges = self.conf.get('bridge', DEFAULT_BRIDGE).split(',')
- if macs == ['']:
- macs = []
- if models == ['']:
- models = []
- if bridges == ['']:
- bridges = []
- if len(models) < len(macs) or len(models) < len(bridges):
- raise ValueError('Bad nic specification')
- if models and not (macs or bridges):
- raise ValueError('Bad nic specification')
- if not macs or not models or not bridges:
- return ''
- macs = macs + [macs[-1]] * (len(models) - len(macs))
- bridges = bridges + [bridges[-1]] * (len(models) - len(bridges))
-
- for mac, model, bridge in zip(macs, models, bridges):
- if model == 'pv':
- model = 'virtio'
- nics.append({'type': NIC_DEVICES, 'macAddr': mac,
- 'nicModel': model, 'network': bridge,
- 'device': 'bridge'})
- return nics
-
- def getConfDrives(self):
- """
- Normalize drives provided by conf.
- """
- # FIXME
- # Will be better to change the self.conf but this implies an API change
- # Remove this when the API parameters will be consistent.
- confDrives = self.conf.get('drives', [])
- if not confDrives:
- confDrives.extend(self.__legacyDrives())
- confDrives.extend(self.__removableDrives())
-
- for drv in confDrives:
- drv['type'] = DISK_DEVICES
- drv['format'] = drv.get('format') or 'raw'
- drv['propagateErrors'] = drv.get('propagateErrors') or 'off'
- drv['readonly'] = False
- drv['shared'] = False
- # FIXME: For BC we have now two identical keys: iface = if
- # Till the day that conf will not returned as a status anymore.
- drv['iface'] = drv.get('iface') or drv.get('if', 'ide')
-
- # Update indices for drives devices
- self.normalizeDrivesIndices(confDrives)
-
- return confDrives
-
def updateDriveIndex(self, drv):
if not drv['iface'] in self._usedIndices:
self._usedIndices[drv['iface']] = []
@@ -2825,9 +2659,9 @@
def _run(self):
self.log.info("VM wrapper has started")
self.conf['smp'] = self.conf.get('smp', '1')
+ devices = self.getConfDevices()
if not 'recover' in self.conf:
- devices = self.buildConfDevices()
self.preparePaths(devices[DISK_DEVICES])
# Update self.conf with updated devices
# For old type vmParams, new 'devices' key will be
@@ -2851,10 +2685,7 @@
# For BC we should to keep running VM run after vdsm upgrade.
# So, because this vm doesn't have normalize conf we need to build
# it in recovery flow
- if not self.conf.get('devices'):
- devices = self.buildConfDevices()
- else:
- devices = self.getConfDevices()
+ pass
devMap = {DISK_DEVICES: Drive,
NIC_DEVICES: NetworkInterfaceDevice,
--
To view, visit http://gerrit.ovirt.org/18047
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2712148b670c9f85beaea40a0b2e870d829b2b4b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpoledni(a)redhat.com>
9 years, 10 months
Change in vdsm[master]: lvm: Do not use udev cache for obtaining device list
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: lvm: Do not use udev cache for obtaining device list
......................................................................
lvm: Do not use udev cache for obtaining device list
lvm is obtaining the device list from udev. When using concurrently,
udev sometimes returns incomplete list, which cause lvm to think that a
vg is missing, and the command may fail with "Volume group not found"
error, or "Cannot change VG test while PVs are missing".
lvm fixed this issue in version 2.02.100-7.el6 by disabling udev cache,
setting obtain_device_list_from_udev to 0. Unfortunatlly, lvm fix is not
enough for vdsm, as the fix is applied only if no lvm.conf file exists.
When upgrading existing lvm installation, lvm creates a lvm.conf.rpmnew
file, and the system administrator is responsible for updating lvm
configuration.
This patch disable udev cache using the --config option, used to
override many other lvm options, ensuring proper configuration on both
new and upgraded systems.
Disabling udev cache may have minimal performance effect according to
lvm developers.
Change-Id: Ib55c8d444f3be9f63bfd23d8def60607b5b3dff0
Bug-Url: https://bugzilla.redhat.com/1014942
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/storage/lvm.py
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/90/20890/1
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index 0c2964e..065e1ea 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -105,6 +105,7 @@
ignore_suspended_devices=1
write_cache_state=0
disable_after_error_count=3
+obtain_device_list_from_udev=0
%s
}
--
To view, visit http://gerrit.ovirt.org/20890
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib55c8d444f3be9f63bfd23d8def60607b5b3dff0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
9 years, 10 months
Change in vdsm[master]: Allow disable MOM KSM control.
by apahim@redhat.com
Amador Pahim has uploaded a new change for review.
Change subject: Allow disable MOM KSM control.
......................................................................
Allow disable MOM KSM control.
This patch add ksmEnabled var to enable/disable mom ksm control.
Now users can use vdsClient to runtime disable/enable
(default enabled) ksm control:
$ vdsClient -s 0 setMOMPolicyParameters ksmEnabled=False
Change-Id: Icc4333ce92561e23c062c398e24f876a74056a05
Bug-Url: http://bugzilla.redhat.com/1025780
Signed-off-by: Amador Pahim <apahim(a)redhat.com>
---
M vdsm/mom.d/01-parameters.policy
M vdsm/mom.d/03-ksm.policy
2 files changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/79/20879/1
diff --git a/vdsm/mom.d/01-parameters.policy b/vdsm/mom.d/01-parameters.policy
index 980e71c..97803d5 100644
--- a/vdsm/mom.d/01-parameters.policy
+++ b/vdsm/mom.d/01-parameters.policy
@@ -1 +1,2 @@
(defvar balloonEnabled 0)
+(defvar ksmEnabled 1)
diff --git a/vdsm/mom.d/03-ksm.policy b/vdsm/mom.d/03-ksm.policy
index 415fcfd..5a3b1bd 100644
--- a/vdsm/mom.d/03-ksm.policy
+++ b/vdsm/mom.d/03-ksm.policy
@@ -41,8 +41,8 @@
(defvar ksm_pressure_threshold (* Host.mem_available ksm_free_percent))
(defvar ksm_committed Host.ksm_shareable)
-(if (and (< (+ ksm_pressure_threshold ksm_committed) Host.mem_available)
- (> (Host.StatAvg "mem_free") ksm_pressure_threshold))
+(if (or (and (< (+ ksm_pressure_threshold ksm_committed) Host.mem_available)
+ (> (Host.StatAvg "mem_free") ksm_pressure_threshold)) (not ksmEnabled))
(Host.Control "ksm_run" 0)
{ # else
(Host.Control "ksm_run" 1)
--
To view, visit http://gerrit.ovirt.org/20879
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc4333ce92561e23c062c398e24f876a74056a05
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amador Pahim <apahim(a)redhat.com>
9 years, 10 months
Change in vdsm[master]: Infra: Create AsyncProcessOperation
by smizrahi@redhat.com
Saggi Mizrahi has uploaded a new change for review.
Change subject: Infra: Create AsyncProcessOperation
......................................................................
Infra: Create AsyncProcessOperation
This is an object to wrap a process so it can be treated as an
AsyncOperation.
Features:
* Takes care of pid collection
* Has pluggable output parsing
* Process appropriate implementation of wait() and stop()
Change-Id: I79d0eefc9d917a4a93916d52867fb4f1e793c60e
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M lib/vdsm/utils.py
M tests/utilsTests.py
2 files changed, 113 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/54/19254/1
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index d3e0c2b..5ab2cb7 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -48,6 +48,7 @@
import subprocess
import threading
import time
+import zombieReaper
from cpopen import CPopen as BetterPopen
from config import config
@@ -914,6 +915,54 @@
time.sleep(sleep)
+class AsyncProcessOperation(object):
+ def __init__(self, proc, resultParser=None):
+ """Wraps a running process operation. resultParser should be of type
+ callback(rc, out, err) and can return anything or throw
+ exceptions."""
+ self._lock = threading.Lock()
+
+ self._result = None
+ self._resultParser = resultParser
+
+ self._proc = proc
+ zombieReaper.autoReapPID(self._proc.pid)
+
+ def wait(self, timeout=None, cond=None):
+ """Waits until the process has exited, the timeout has been reached or
+ the condition has been met"""
+ self._proc.wait(timeout, cond)
+
+ def stop(self):
+ """Stops the running operaions, effectively sending a kill signal to
+ the process"""
+ self._proc.kill()
+
+ def result(self):
+ """Returns the result in the as a tuple of (result, error).
+ if the operation is still running it will block until it returns.
+
+ The if no resultParser has been set the default result
+ is (rc, out, err) """
+ with self._lock:
+ if self._result is None:
+ out, err = self._proc.communicate()
+ rc = self._proc.returncode
+ if rc == 0:
+ if self._resultParser is not None:
+ try:
+ self._result = (self._resultParser(rc, out, err),
+ None)
+ except Exception as e:
+ self._result = (None, e)
+ else:
+ self._result = ((rc, out, err), None)
+
+ self._done = True
+
+ return self._result
+
+
def panic(msg):
logging.error("Panic: %s", msg, exc_info=True)
os.killpg(0, 9)
diff --git a/tests/utilsTests.py b/tests/utilsTests.py
index a6a222d..cbe7929 100644
--- a/tests/utilsTests.py
+++ b/tests/utilsTests.py
@@ -22,6 +22,7 @@
from testrunner import VdsmTestCase as TestCaseBase
from vdsm import utils
from storage import misc
+import time
class RetryTests(TestCaseBase):
@@ -80,3 +81,66 @@
class GeneralUtilsTests(TestCaseBase):
def testPanic(self):
self.assertRaises(AssertionError, utils.panic, "panic test")
+
+
+class AsyncProcessOperationTests(TestCaseBase):
+ def _echo(self, text):
+ proc = misc.execCmd(["echo", "-n", "test"], sync=False)
+
+ def parse(rc, out, err):
+ return out
+
+ return utils.AsyncProcessOperation(proc, parse)
+
+ def _sleep(self, t):
+ proc = misc.execCmd(["sleep", str(t)], sync=False)
+ return utils.AsyncProcessOperation(proc)
+
+ def _fail(self, t):
+ proc = misc.execCmd(["sleep", str(t)], sync=False)
+
+ def parse(rc, out, err):
+ raise Exception("TEST!!!")
+
+ return utils.AsyncProcessOperation(proc, parse)
+
+ def test(self):
+ aop = self._sleep(1)
+ self.assertEquals(aop.result(), ((0, "", ""), None))
+
+ def testAlreadyExitedSuccess(self):
+ aop = self._sleep(0)
+ time.sleep(1)
+ self.assertEquals(aop.result(), ((0, "", ""), None))
+
+ def testAlreadyExitedFail(self):
+ aop = self._sleep("hello")
+ time.sleep(1)
+ self.assertEquals(aop.result(), (
+ (0, "",
+ "sleep: invalid time interval 'hello'\n"
+ "Try 'sleep --help' for more information.\n"), None))
+
+ def testWait(self):
+ aop = self._sleep(1)
+ aop.wait(timeout=2)
+
+ def testParser(self):
+ aop = self._echo("test")
+ self.assertEquals(aop.result(), ("test", None))
+
+ def testStop(self):
+ aop = self._sleep(10)
+ aop.stop()
+
+ start = time.time()
+ aop.result()
+ end = time.time()
+ duration = end - start
+ self.assertTrue(duration < 2)
+
+ def testException(self):
+ aop = self._fail(1)
+ res, err = aop.result()
+ self.assertEquals(res, None)
+ self.assertNotEquals(err, None)
--
To view, visit http://gerrit.ovirt.org/19254
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I79d0eefc9d917a4a93916d52867fb4f1e793c60e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
9 years, 10 months
Change in vdsm[master]: Don't fail hotplugNic operation when after hook fails
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Don't fail hotplugNic operation when after hook fails
......................................................................
Don't fail hotplugNic operation when after hook fails
Change-Id: I8df7812cee7632addf87f7dc1c49182f55c51e8e
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1015171
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm/hooks.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/76/20876/1
diff --git a/vdsm/hooks.py b/vdsm/hooks.py
index a801a15..c983326 100644
--- a/vdsm/hooks.py
+++ b/vdsm/hooks.py
@@ -251,7 +251,7 @@
def after_nic_hotplug(nicxml, vmconf={}, params={}):
return _runHooksDir(nicxml, 'after_nic_hotplug', vmconf=vmconf,
- params=params)
+ params=params, raiseError=False)
def before_nic_hotunplug(nicxml, vmconf={}, params={}):
--
To view, visit http://gerrit.ovirt.org/20876
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8df7812cee7632addf87f7dc1c49182f55c51e8e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
9 years, 10 months
Change in vdsm[master]: upgrade: fix v3ResetMetaVolSize argument
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: upgrade: fix v3ResetMetaVolSize argument
......................................................................
upgrade: fix v3ResetMetaVolSize argument
In commit c072945 (one shot prepare) the v3ResetMetaVolSize argument
was changed from volume object to volume uuid (string) triggering
attribute errors during the execution (e.g. getMetaParam, etc.).
This patch fixes the issue reintroducing the volume objects and the
relevant exception handling.
Change-Id: Iddffa996652300e5a5daa19bef5bd7873f39bb15
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/imageRepository/formatConverter.py
1 file changed, 15 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/21/20721/1
diff --git a/vdsm/storage/imageRepository/formatConverter.py b/vdsm/storage/imageRepository/formatConverter.py
index a95bfe6..441f484 100644
--- a/vdsm/storage/imageRepository/formatConverter.py
+++ b/vdsm/storage/imageRepository/formatConverter.py
@@ -274,13 +274,25 @@
log.error("Image %s can't be activated.",
imgUUID, exc_info=True)
- for vol in imgVolumes:
+ for volUUID in imgVolumes:
try:
- v3ResetMetaVolSize(vol) # BZ#811880
+ v3ResetMetaVolSize( # BZ#811880
+ domain.produceVolume(imgUUID, volUUID))
except qemuImg.QImgError:
log.error("It is not possible to read the volume %s "
"using qemu-img, the content looks damaged",
- vol.volUUID, exc_info=True)
+ volUUID, exc_info=True)
+
+ except se.VolumeDoesNotExist:
+ log.error("It is not possible to prepare the image %s, the "
+ "volume chain looks damaged", imgUUID,
+ exc_info=True)
+
+ except se.MetaDataKeyNotFoundError:
+ log.error("It is not possible to prepare the image %s, the "
+ "volume metadata looks damaged", imgUUID,
+ exc_info=True)
+
finally:
try:
domain.deactivateImage(imgUUID)
--
To view, visit http://gerrit.ovirt.org/20721
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iddffa996652300e5a5daa19bef5bd7873f39bb15
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
9 years, 10 months