MCPcopy
hub / github.com/retspen/webvirtcloud / wvmEventLoop

Class wvmEventLoop

vrtManager/connection.py:19–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17
18
19class wvmEventLoop(threading.Thread):
20 def __init__(self, group=None, target=None, name=None, args=(), kwargs={}):
21 # register the default event implementation
22 # of libvirt, as we do not have an existing
23 # event loop.
24 libvirt.virEventRegisterDefaultImpl()
25
26 if name is None:
27 name = 'libvirt event loop'
28
29 super(wvmEventLoop, self).__init__(group, target, name, args, kwargs)
30
31 # we run this thread in deamon mode, so it does
32 # not block shutdown of the server
33 self.daemon = True
34
35 def run(self):
36 while True:
37 # if this method will fail it raises libvirtError
38 # we do not catch the exception here so it will show up
39 # in the logs. Not sure when this call will ever fail
40 libvirt.virEventRunDefaultImpl()
41
42
43class wvmConnection(object):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected