Change in vdsm[master]: vdsm: Utilize CallbackChain in vm.shutdown

fromani at redhat.com fromani at redhat.com
Thu Jan 30 16:03:10 UTC 2014


Francesco Romani has posted comments on this change.

Change subject: vdsm: Utilize CallbackChain in vm.shutdown
......................................................................


Patch Set 2:

(3 comments)

http://gerrit.ovirt.org/#/c/23457/2/vdsm/vm.py
File vdsm/vm.py:

Line 1864:         if vm.guestAgent and vm.guestAgent.isResponsive():
Line 1865:             self.chain.addCallback(callbacks['guestAgent'], delay, message)
Line 1866: 
Line 1867:         # then acpi if enabled
Line 1868:         if utils.tobool(vm.conf.get('acpiEnable', 'true')):
> utils.tobool is case invariant and I didn't see particular reason to break 
Just to explain myself better: I was thinking more to something like

  if utils.tobool(vm.conf.get('acpiEnable', True)):
    # ...

so, to preserve utils.tobool to fix anything strange could end up in vm.conf, but to provide a default which is already a boolean.
However, no big deal, can stay as it is.
Line 1869:             self.chain.addCallback(callbacks['acpi'])
Line 1870: 
Line 1871:     def start(self):
Line 1872:         # are there any available methods for shutdown/reboot?


Line 2018: 
Line 2019:         if (self.arch not in ['ppc64', 'x86_64']):
Line 2020:             raise RuntimeError('Unsupported architecture: %s' % self.arch)
Line 2021: 
Line 2022:         self._powerDownEvent = threading.Event()
> Where would you suggest for the _powerDownEvent object to be constructed? I
My bad :) wrong line...
Line 2023: 
Line 2024:     def _get_lastStatus(self):
Line 2025:         PAUSED_STATES = ('Powering down', 'RebootInProgress', 'Up')
Line 2026:         if not self._guestCpuRunning and self._lastStatus in PAUSED_STATES:


Line 2390:             elif self.user_destroy:
Line 2391:                 self.setDownStatus(NORMAL, 'User shut down')
Line 2392:             else:
Line 2393:                 self.setDownStatus(ERROR, "Lost connection with qemu process")
Line 2394:         self._powerDownEvent.set()
...I was referring to this line in the comment of the line 2022 above.
Line 2395: 
Line 2396:     def _loadCorrectedTimeout(self, base, doubler=20, load=None):
Line 2397:         """
Line 2398:         Return load-corrected base timeout


-- 
To view, visit http://gerrit.ovirt.org/23457
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I8cc4f4140913df9827cca296e880b37f47a21b76
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Betak <mbetak at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Martin Betak <mbetak at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list