def run(self):
# Close connection on exit (to test cleanup paths)
self.tid = get_tid()
log.info('starting thread: {} (TID {})'.format(self.name, self.tid))
old_exitfunc = getattr(sys, 'exitfunc', None)
def exit():
log.info('Closing hypervisors connexions')
for hyp_id, hostname in self.hyps.items():
self.hyps_conn[hyp_id].close()
if (old_exitfunc): old_exitfunc()
sys.exitfunc = exit
# self.r_status = RethinkHypEvent()
self.thread_event_loop = virEventLoopNativeStart()
for hyp_id, hostname in self.hyps.items():
self.add_hyp_to_receive_events(hyp_id)
while self.stop is not True:
time.sleep(0.1)
if self.stop is True:
for hyp_id in self.hyps:
self.del_hyp_to_receive_events(hyp_id)
评论列表
文章目录