Francesco Romani has uploaded a new change for review. Change subject: guest manager, monitor: remove implicit start() ......................................................................
guest manager, monitor: remove implicit start() For classes qhich inherits from threading.Thread(), implicit start() in __init__ is generally considered a bad idea. This patch makes the start() explicit for better clarity. Moreover, future patches want to control the actual starting of threads, so this patch paves the road for them. Change-Id: Ia06bc0d9db0f53ae4c50aa7d25956ec626d8a1cc Signed-off-by: Francesco Romani <from...@redhat.com> --- M mom/GuestManager.py M mom/GuestMonitor.py M mom/__init__.py 3 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/mom refs/changes/89/31589/1 diff --git a/mom/GuestManager.py b/mom/GuestManager.py index fc3244d..5aa50c3 100644 --- a/mom/GuestManager.py +++ b/mom/GuestManager.py @@ -35,7 +35,6 @@ self.logger = logging.getLogger('mom.GuestManager') self.guests = {} self.guests_sem = threading.Semaphore() - self.start() def spawn_guest_monitors(self, domain_list): """ @@ -52,6 +51,7 @@ "can't start", id) continue guest = GuestMonitor(self.config, info, self.hypervisor_iface) + guest.start() if guest.isAlive(): self.guests_sem.acquire() if id not in self.guests: diff --git a/mom/GuestMonitor.py b/mom/GuestMonitor.py index 635203a..47fd9f5 100644 --- a/mom/GuestMonitor.py +++ b/mom/GuestMonitor.py @@ -45,7 +45,6 @@ if self.collectors is None: self.logger.error("Guest Monitor initialization failed") return - self.start() def run(self): try: diff --git a/mom/__init__.py b/mom/__init__.py index 97c0c11..2f0a0a8 100644 --- a/mom/__init__.py +++ b/mom/__init__.py @@ -29,6 +29,7 @@ if not hypervisor_iface: self.shutdown() guest_manager = GuestManager(self.config, hypervisor_iface) + guest_manager.start() policy_engine = PolicyEngine(self.config, hypervisor_iface, host_monitor, \ guest_manager) -- To view, visit http://gerrit.ovirt.org/31589 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia06bc0d9db0f53ae4c50aa7d25956ec626d8a1cc Gerrit-PatchSet: 1 Gerrit-Project: mom Gerrit-Branch: master Gerrit-Owner: Francesco Romani <from...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches