Change in vdsm[master]: vm: abort vm start if can't read pid
danken at redhat.com
danken at redhat.com
Sat Dec 13 22:03:39 UTC 2014
Dan Kenigsberg has posted comments on this change.
Change subject: vm: abort vm start if can't read pid
......................................................................
Patch Set 1: Code-Review-1
(3 comments)
http://gerrit.ovirt.org/#/c/36129/1/vdsm/virt/vm.py
File vdsm/virt/vm.py:
Line 2704: self.conf['pauseCode'] = self._initTimePauseCode
Line 2705: if self._initTimePauseCode == 'ENOSPC':
Line 2706: self.cont()
Line 2707:
Line 2708: self.conf['pid'] = str(self._getPid())
I don't recall (and did not check....): is this called during recovery? I think it should not, as qemu pid would not change.
It would be a shame if a supervdsm restart (or bug) would cause us to loose a long-running VM.
Line 2709:
Line 2710: nice = int(self.conf.get('nice', '0'))
Line 2711: nice = max(min(nice, 19), 0)
Line 2712:
Line 4356: for dev in self.conf.get('devices', [])
Line 4357: if dev['type'] == GRAPHICS_DEVICES))
Line 4358:
Line 4359: def _getPid(self):
Line 4360: pid = 0
if we raise on error, we don't need this pre-assignment; returning pid on the "else" clause of the try-block would be simpler and nicer.
Line 4361: try:
Line 4362: vmName = self.conf['vmName'].encode('utf-8')
Line 4363: pid = int(supervdsm.getProxy().getVmPid(vmName))
Line 4364: if pid <= 0:
Line 4365: self.log.error('read invalid pid: %i', pid)
Line 4366: raise MissingVmPidError()
Line 4367: except (IOError, ValueError):
Line 4368: self.log.error('cannot read pid')
Line 4369: raise MissingVmPidError()
why do we need this (possibly incomplete) exception translation? I think that our handling of any Exception by _startUnderlyingVm is currently correct.
if we do need this translation, please re-raise with the original traceback, so we don't loose information in debug time.
Line 4370: return pid
Line 4371:
Line 4372: def _updateDomainDescriptor(self):
Line 4373: domainXML = self._dom.XMLDesc(0)
--
To view, visit http://gerrit.ovirt.org/36129
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1b80baba14caded2fb3ef74451498751347323ea
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list