From 0d20639cc1b5894c9e29d0a272c05a414c8309bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?= Date: Sun, 17 Mar 2019 20:06:26 +0100 Subject: [PATCH] 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. --- qubes/qmemman/__init__.py | 4 ++++ qubes/tools/qmemmand.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/qubes/qmemman/__init__.py b/qubes/qmemman/__init__.py index 1c7ff780..9876db4c 100644 --- a/qubes/qmemman/__init__.py +++ b/qubes/qmemman/__init__.py @@ -57,6 +57,10 @@ class SystemState(object): self.log.debug('SystemState()') self.domdict = {} + self.xc = None + self.xs = None + + def init(self): self.xc = xen.lowlevel.xc.xc() self.xs = xen.lowlevel.xs.xs() self.BALOON_DELAY = 0.1 diff --git a/qubes/tools/qmemmand.py b/qubes/tools/qmemmand.py index 640e8051..df90ca69 100644 --- a/qubes/tools/qmemmand.py +++ b/qubes/tools/qmemmand.py @@ -276,6 +276,10 @@ def main(): log.debug('instantiating server') os.umask(0) + + # Initialize the connection to Xen and to XenStore + system_state.init() + server = socketserver.UnixStreamServer(SOCK_PATH, QMemmanReqHandler) os.umask(0o077)