Francesco Romani has uploaded a new change for review. Change subject: vm: split guest agent init from domDependentInit ......................................................................
vm: split guest agent init from domDependentInit Move into an helper to modularize Vm._domDependentInit() with no change of behaviour. Change-Id: I13e456d101659848c494f2c27912303c294ccf9f Signed-off-by: Francesco Romani <from...@redhat.com> --- M vdsm/virt/vm.py 1 file changed, 19 insertions(+), 16 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/16/59816/1 diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index 470b627..4a545b2 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -1845,22 +1845,7 @@ self._dom_init_devices() self._guestEventTime = self._startTime - try: - self.guestAgent.start() - except Exception: - self.log.exception("Failed to connect to guest agent channel") - - try: - if self.conf.get('enableGuestEvents', False): - if self.lastStatus == vmstatus.MIGRATION_DESTINATION: - self.guestAgent.events.after_migration() - elif self.lastStatus == vmstatus.RESTORING_STATE: - self.guestAgent.events.after_hibernation() - except Exception: - self.log.exception("Unexpected error on guest event notification") - - # Drop enableGuestEvents from conf - Not required from here anymore - self.conf.pop('enableGuestEvents', None) + self._dom_init_guest_agent() self._guestCpuRunning = self._isDomainRunning() self._logGuestCpuStatus('domain initialization') @@ -1879,6 +1864,24 @@ self._dom_init_sla() + def _dom_init_guest_agent(self): + try: + self.guestAgent.start() + except Exception: + self.log.exception("Failed to connect to guest agent channel") + + try: + if self.conf.get('enableGuestEvents', False): + if self.lastStatus == vmstatus.MIGRATION_DESTINATION: + self.guestAgent.events.after_migration() + elif self.lastStatus == vmstatus.RESTORING_STATE: + self.guestAgent.events.after_hibernation() + except Exception: + self.log.exception("Unexpected error on guest event notification") + + # Drop enableGuestEvents from conf - Not required from here anymore + self.conf.pop('enableGuestEvents', None) + def _dom_init_devices(self): # REQUIRED_FOR migrate from vdsm-4.16 # -- To view, visit https://gerrit.ovirt.org/59816 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I13e456d101659848c494f2c27912303c294ccf9f Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani <from...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org