[CRIU] [PATCH 06/10] p.haul: rename stop fd variable to simplify code

Nikita Spiridonov nspiridonov at odin.com
Fri Oct 9 10:11:38 PDT 2015


Rename sfd variable in p.haul-service to stop_fd and get_stop_fd
method in xem_rpc.py to init_stop_fd to simplify code.

Signed-off-by: Nikita Spiridonov <nspiridonov at odin.com>
---
 p.haul-service   |    6 +++---
 phaul/xem_rpc.py |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/p.haul-service b/p.haul-service
index ad899d5..858b0ff 100755
--- a/p.haul-service
+++ b/p.haul-service
@@ -25,10 +25,10 @@ def log_uncaught_exception(type, value, traceback):
 	logging.error(value, exc_info=(type, value, traceback))
 sys.excepthook = log_uncaught_exception
 
-sfd = None
+stop_fd = None
 def fin(foo, bar):
 	logging.info("Stop by %d", foo)
-	sfd.close()
+	stop_fd.close()
 
 logging.info("Starting p.haul service")
 
@@ -40,7 +40,7 @@ t = phaul.xem_rpc.rpc_threaded_srv(phaul.p_haul_service.phaul_service,
 	connection)
 
 # FIXME: Setup stop handlers
-sfd = t.get_stop_fd()
+stop_fd = t.init_stop_fd()
 signal.signal(signal.SIGTERM, fin)
 signal.signal(signal.SIGINT, fin)
 
diff --git a/phaul/xem_rpc.py b/phaul/xem_rpc.py
index bafd994..0d9f09e 100644
--- a/phaul/xem_rpc.py
+++ b/phaul/xem_rpc.py
@@ -111,7 +111,7 @@ class rpc_threaded_srv(threading.Thread):
 		except:
 			logging.exception("Exception in rpc_threaded_srv")
 
-	def get_stop_fd(self):
+	def init_stop_fd(self):
 		sks = socket.socketpair()
 		self._stop_fd = sks[0]
 		return sks[1]
-- 
1.7.1



More information about the CRIU mailing list