Francesco Romani has uploaded a new change for review.
Change subject: vm: per-attribute monitor response check
......................................................................
vm: per-attribute monitor response check
the responsiveness of the monitor is reported through a single
instance variable, which is updated after each libvirt call.
If one single call goes in timeout, while the others go well,
due to interplay between timeouts and polling interval, it can
happen that reported status bounces back and forth between 'Up'
and 'Not Responding'.
This patch address this behaviour by keeping track of the
timeouts per-dom-attribute instead of per-dom, and reports
the monitor as not respondig if, and until, at least one had
a timeout in the last call.
Change-Id: I32a98d34cde91fa9dc3d07f03c47a5f2f22da620
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 12 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/23138/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 55683f4..9d7ca03 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -853,11 +853,11 @@
def f(*args, **kwargs):
try:
ret = attr(*args, **kwargs)
- self._cb(False)
+ self._cb(False, name)
return ret
except libvirt.libvirtError as e:
if e.get_error_code() == libvirt.VIR_ERR_OPERATION_TIMEOUT:
- self._cb(True)
+ self._cb(True, name)
toe = TimeoutError(e.get_error_message())
toe.err = e.err
raise toe
@@ -1938,6 +1938,9 @@
if (self.arch not in ['ppc64', 'x86_64']):
raise RuntimeError('Unsupported architecture: %s' % self.arch)
+
+ self._attrTimeoutLock = threading.Lock()
+ self._attrTimeoutExperienced = {} # will keep track of timeout data
def _get_lastStatus(self):
PAUSED_STATES = ('Powering down', 'RebootInProgress', 'Up')
@@ -3631,11 +3634,13 @@
def _monitorDependentInit(self, timeout=None):
self.log.warning('unsupported by libvirt vm')
- def _timeoutExperienced(self, timeout):
- if timeout:
- self._monitorResponse = -1
- else:
- self._monitorResponse = 0
+ def _timeoutExperienced(self, timeout, attrName):
+ with self._attrTimeoutLock:
+ self._attrTimeoutExperienced[attrName] = timeout
+ if any(self._attrTimeoutExperienced.itervalues()):
+ self._monitorResponse = -1
+ else:
+ self._monitorResponse = 0
def _waitForIncomingMigrationFinish(self):
if 'restoreState' in self.conf:
--
To view, visit http://gerrit.ovirt.org/23138
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I32a98d34cde91fa9dc3d07f03c47a5f2f22da620
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Saggi Mizrahi has uploaded a new change for review.
Change subject: stomp: Make sure the \0 is read before slicing the buffer
......................................................................
stomp: Make sure the \0 is read before slicing the buffer
In python if you try and slice past the end of the list\string
you get an empty string and not an IndexError
The original code check that we got all the data and sliced past
the ending \0. But on rare cases where the message ended exactly
with all the content but the \0 was not received.
The slicing code would silently ignore the fact that the index doesn't
exist and would return an empty string and switch the parser state
making all future data have the wrong offset.
This in turn made the command '\0SEND' instead of 'SEND' which has
no handler and where silently ignored. The only way to solve this was to
reconnect.
Bug-Url: http://bugzilla.redhat.com/1169100
Change-Id: Ie0d8eaae161f3ec6c77726f4f9da044ab7c629d4
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M lib/yajsonrpc/stomp.py
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/35938/1
diff --git a/lib/yajsonrpc/stomp.py b/lib/yajsonrpc/stomp.py
index 04c23ba..d99ed98 100644
--- a/lib/yajsonrpc/stomp.py
+++ b/lib/yajsonrpc/stomp.py
@@ -247,9 +247,12 @@
buf = self._get_buffer()
cl = self._contentLength
ndata = len(buf)
- if ndata < cl:
+ if ndata < (cl + 1):
return False
+ if buf[cl] != "\0":
+ raise RuntimeError("Frame end is missing \\0")
+
remainingBytes = 0
self._flush()
body = buf
--
To view, visit http://gerrit.ovirt.org/35938
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0d8eaae161f3ec6c77726f4f9da044ab7c629d4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
Francesco Romani has uploaded a new change for review.
Change subject: vm: hyperv: hyperv enlightenment optimizations
......................................................................
vm: hyperv: hyperv enlightenment optimizations
This patch the hyperv enlightenment optimizations.
The optimizations are both for stability and for performance, and they
are added on top of the HyperV support.
The parameters are hardcoded and not externally configurable because
they are not supposed to be changed very often, if changed at all;
moreover, this patch already implements the optimal recommended settings.
Change-Id: Ia10cb4ce254b6e6f560c045aff9e68846fe4771f
Bug-Url: https://bugzilla.redhat.com/1083529
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M tests/vmTests.py
M vdsm/virt/vm.py
2 files changed, 18 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/34/29234/1
diff --git a/tests/vmTests.py b/tests/vmTests.py
index 7ee2eb8..9317887 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -327,6 +327,8 @@
<acpi/>
<hyperv>
<relaxed state="on"/>
+ <vapic state="on"/>
+ <spinlocks retries="8191" state="on"/>
</hyperv>
</features>"""
conf = {'hypervEnable': 'true'}
@@ -382,7 +384,7 @@
def testHyperVClockXML(self):
clockXML = """
<clock adjustment="-3600" offset="variable">
- <timer name="rtc" tickpolicy="catchup" track="guest"/>
+ <timer name="hypervclock" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
</clock>"""
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index ec8ca12..4f3c531 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -717,13 +717,20 @@
<clock offset="variable" adjustment="-3600">
<timer name="rtc" tickpolicy="catchup">
</clock>
+
+ for hyperv:
+ <clock offset="variable" adjustment="-3600">
+ <timer name="hypervclock" tickpolicy="catchup">
+ </clock>
"""
+
+ clockName = 'hypervclock' if self._isHyperV() else 'rtc'
+ # 'hypervclock' does not support the 'track' attribute.
+ # libvirt docs is not very clear here.
m = XMLElement('clock', offset='variable',
adjustment=str(self.conf.get('timeOffset', 0)))
- rtc = m.appendChildWithArgs('timer', name='rtc', tickpolicy='catchup')
- if utils.tobool(self.conf.get('hypervEnable', 'false')):
- rtc.setAttrs(track='guest')
+ m.appendChildWithArgs('timer', name=clockName, tickpolicy='catchup')
m.appendChildWithArgs('timer', name='pit', tickpolicy='delay')
if self.arch == caps.Architecture.X86_64:
@@ -841,6 +848,11 @@
hyperv.appendChildWithArgs('relaxed', state='on')
# turns off an internal Windows watchdog, and by doing so avoids
# some high load BSODs.
+ hyperv.appendChildWithArgs('vapic', state='on')
+ hyperv.appendChildWithArgs(
+ 'spinlocks', state='on', retries='8191')
+ # performance optimization flags, that can improve the performance
+ # by 10% to much more (in extreme cases of resources overcommit).
def appendCpu(self):
"""
--
To view, visit http://gerrit.ovirt.org/29234
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia10cb4ce254b6e6f560c045aff9e68846fe4771f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Francesco Romani has uploaded a new change for review.
Change subject: vm: remove guest agent channels tunables
......................................................................
vm: remove guest agent channels tunables
We had tunables to disable vm/ga channels
creation from a long time, but it was just on
debug purposes and these settings should never
be used in production.
Moreover, we acttually rely on the channel being
here (see RHBZ#1126887).
Since it is now possible the achive the same results
through hooks, is time to drop these tunables.
Change-Id: I4774441d7bd6dcdbb58e38886eb522851d4af37c
Relates-To: https://bugzilla.redhat.com/1126887
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M client/vdsClient.py
M tests/vmTestsData.py
M vdsm/virt/vm.py
3 files changed, 6 insertions(+), 19 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/45/31245/1
diff --git a/client/vdsClient.py b/client/vdsClient.py
index 2c09b28..ca82519 100644
--- a/client/vdsClient.py
+++ b/client/vdsClient.py
@@ -1869,7 +1869,6 @@
# 'want to reserve with the machine'
'o acpiEnable : If present will remove the default '
'-no-acpi switch',
- 'o qgaEnable : use qemu-ga as guest agent',
'o spiceSecureChannels : comma-separated list of '
'spice channel that will be encrypted',
'o spiceMonitors : number of emulated screen heads',
diff --git a/tests/vmTestsData.py b/tests/vmTestsData.py
index 02959fd..0990641 100644
--- a/tests/vmTestsData.py
+++ b/tests/vmTestsData.py
@@ -27,7 +27,6 @@
'acpiEnable': 'true', 'cpuType': 'qemu64',
'smpCoresPerSocket': 1, 'smpThreadsPerCore': 1,
'smp': '1', 'cpuPinning': {}, 'numaTune': {}, 'maxVCpus': '160',
- 'vmchannel': 'true', 'qgaEnable': 'true',
'tabletEnable': False,
'displayNetwork': 'mydisp', 'custom': {},
'guestNumaNodes': []},
@@ -95,7 +94,6 @@
'acpiEnable': 'true', 'cpuType': 'qemu64',
'smpCoresPerSocket': 1, 'smpThreadsPerCore': 1,
'smp': '1', 'cpuPinning': {}, 'numaTune': {}, 'maxVCpus': '160',
- 'vmchannel': 'true', 'qgaEnable': 'true',
'tabletEnable': False,
'displayNetwork': 'mydisp', 'custom': {},
'guestNumaNodes': []},
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 591616d..714b718 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -2689,17 +2689,10 @@
domxml.appendNumaTune()
- if utils.tobool(self.conf.get('vmchannel', 'true')):
- domxml._appendAgentDevice(self._guestSocketFile.decode('utf-8'),
- _VMCHANNEL_DEVICE_NAME)
- else:
- self.log.warning('detected disabled vmchannel.'
- ' This should be done ONLY for debug purposes'
- ' and never in production environments')
- if utils.tobool(self.conf.get('qgaEnable', 'true')):
- domxml._appendAgentDevice(
- self._qemuguestSocketFile.decode('utf-8'),
- _QEMU_GA_DEVICE_NAME)
+ domxml._appendAgentDevice(self._guestSocketFile.decode('utf-8'),
+ _VMCHANNEL_DEVICE_NAME)
+ domxml._appendAgentDevice(self._qemuguestSocketFile.decode('utf-8'),
+ _QEMU_GA_DEVICE_NAME)
domxml.appendInput()
if self.arch == caps.Architecture.PPC64:
@@ -2841,8 +2834,7 @@
# So, run it after you have this info
self._initVmStats()
self.guestAgent = guestagent.GuestAgent(
- self._guestSocketFile, self.cif.channelListener, self.log,
- connect=utils.tobool(self.conf.get('vmchannel', 'true')))
+ self._guestSocketFile, self.cif.channelListener, self.log)
self._guestCpuRunning = self._isDomainRunning()
if self.lastStatus not in (vmstatus.MIGRATION_DESTINATION,
@@ -4010,9 +4002,7 @@
snap.appendChild(_memorySnapshot(memoryVolPath))
else:
snapFlags |= libvirt.VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY
-
- if utils.tobool(self.conf.get('qgaEnable', 'true')):
- snapFlags |= libvirt.VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE
+ snapFlags |= libvirt.VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE
snapxml = snap.toprettyxml()
self.log.debug(snapxml)
--
To view, visit http://gerrit.ovirt.org/31245
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4774441d7bd6dcdbb58e38886eb522851d4af37c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Francesco Romani has uploaded a new change for review.
Change subject: vm: make new timekeeping revertable
......................................................................
vm: make new timekeeping revertable
The commit Icb0752e54a4cb9ff609b8ddfaf5c8fe2ed5b9e72
implemented the new timekeeping options recommended
by QEMU developers.
In order to maximize the backward compatibility and
to deal with possible regression with old guests,
this patch makes the new timekeeping settings revertable
by exposing a new configuration variable.
The default is enabled because those settings, being
recommended, are supposed to be safe.
Change-Id: I471be44454dcae6e73c46a473eb1eee19a5275ab
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M lib/vdsm/config.py.in
M vdsm/vm.py
2 files changed, 8 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/43/24443/1
diff --git a/lib/vdsm/config.py.in b/lib/vdsm/config.py.in
index 01590a1..075face 100644
--- a/lib/vdsm/config.py.in
+++ b/lib/vdsm/config.py.in
@@ -192,6 +192,9 @@
('transient_disks_repository', '@VDSMLIBDIR@/transient',
'Local path to the transient disks repository.'),
+
+ ('new_timekeeping_enable', 'true',
+ 'Enable the new recomended QEMU time keeping settings'),
]),
# Section: [ksm]
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 9371049..d3baca8 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -970,10 +970,12 @@
m = XMLElement('clock', offset='variable',
adjustment=str(self.conf.get('timeOffset', 0)))
m.appendChildWithArgs('timer', name='rtc', tickpolicy='catchup')
- m.appendChildWithArgs('timer', name='pit', tickpolicy='delay')
- if self.arch == caps.Architecture.X86_64:
- m.appendChildWithArgs('timer', name='hpet', present='no')
+ if config.getboolean('vars', 'new_timekeeping_enable'):
+ m.appendChildWithArgs('timer', name='pit', tickpolicy='delay')
+
+ if self.arch == caps.Architecture.X86_64:
+ m.appendChildWithArgs('timer', name='hpet', present='no')
self.dom.appendChild(m)
--
To view, visit http://gerrit.ovirt.org/24443
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I471be44454dcae6e73c46a473eb1eee19a5275ab
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Saggi Mizrahi has uploaded a new change for review.
Change subject: stomp: use the atomic dict.setdefault() instead for check and set
......................................................................
stomp: use the atomic dict.setdefault() instead for check and set
This is faster and simpler.
Change-Id: I28e4925a78328c4ac6cd0b9fc8659d6a3ee27a8f
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M lib/yajsonrpc/stomp.py
1 file changed, 1 insertion(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/37/35937/1
diff --git a/lib/yajsonrpc/stomp.py b/lib/yajsonrpc/stomp.py
index 1dda6d7..04c23ba 100644
--- a/lib/yajsonrpc/stomp.py
+++ b/lib/yajsonrpc/stomp.py
@@ -218,8 +218,7 @@
# the first header entry SHOULD be used as the value of header entry.
# Subsequent values are only used to maintain a history of state
# changes of the header and MAY be ignored.
- if key not in headers:
- headers[key] = value
+ headers.setdefault(key, value)
return True
--
To view, visit http://gerrit.ovirt.org/35937
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I28e4925a78328c4ac6cd0b9fc8659d6a3ee27a8f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>