qmemmand: separate SystemState init xc and xs to a 'init' method

It prevents any connection to xen when initiallizing the class
notably in doc build generation.
This commit is contained in:
Frédéric Pierret (fepitre) 2019-03-17 20:06:26 +01:00
parent 3ba9c6f8d1
commit 0d20639cc1
No known key found for this signature in database
GPG Key ID: 484010B5CDC576E2
2 changed files with 8 additions and 0 deletions

View File

@ -57,6 +57,10 @@ class SystemState(object):
self.log.debug('SystemState()') self.log.debug('SystemState()')
self.domdict = {} self.domdict = {}
self.xc = None
self.xs = None
def init(self):
self.xc = xen.lowlevel.xc.xc() self.xc = xen.lowlevel.xc.xc()
self.xs = xen.lowlevel.xs.xs() self.xs = xen.lowlevel.xs.xs()
self.BALOON_DELAY = 0.1 self.BALOON_DELAY = 0.1

View File

@ -276,6 +276,10 @@ def main():
log.debug('instantiating server') log.debug('instantiating server')
os.umask(0) os.umask(0)
# Initialize the connection to Xen and to XenStore
system_state.init()
server = socketserver.UnixStreamServer(SOCK_PATH, QMemmanReqHandler) server = socketserver.UnixStreamServer(SOCK_PATH, QMemmanReqHandler)
os.umask(0o077) os.umask(0o077)