[CRIU] [PATCH 2/2] p.haul: add --port option

Ruslan Kuprieiev kupruser at gmail.com
Thu Nov 6 16:43:06 PST 2014


Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
---
 p.haul          | 4 +++-
 p_haul_iters.py | 2 +-
 xem_rpc.py      | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/p.haul b/p.haul
index 8c7f181..859ba18 100755
--- a/p.haul
+++ b/p.haul
@@ -4,6 +4,7 @@ import argparse
 import p_haul_iters as ph_iters
 import images
 import criu_api
+import xem_rpc
 
 # Usage idea
 # p.haul <type> <id> <destination>
@@ -27,11 +28,12 @@ parser.add_argument("--dst-rpid", help = "Write pidfile on restore", default = N
 parser.add_argument("--img-path", help = "Dirctory where to put images", default = images.def_path)
 parser.add_argument("--pid-root", help = "Path to tree's FS root")
 parser.add_argument("--force", help = "Don't do any sanity (CPU compat) checks", default = False, action = 'store_true')
+parser.add_argument("--port", help = "Port where to haul", type = int, default = xem_rpc.rpc_port)
 
 args = vars(parser.parse_args())
 
 ph_type = (args.pop("type"), args.pop("id"))
-dst = args.pop("to")
+dst = (args.pop("to"), args.pop("port"))
 
 # Start the migration
 worker = ph_iters.phaul_iter_worker(ph_type, dst)
diff --git a/p_haul_iters.py b/p_haul_iters.py
index 0463e78..9781212 100644
--- a/p_haul_iters.py
+++ b/p_haul_iters.py
@@ -42,7 +42,7 @@ class phaul_iter_worker:
 			raise Exception("No FS driver found")
 
 		self.pid = self.htype.root_task_pid()
-		self.fs.set_target_host(host)
+		self.fs.set_target_host(host[0])
 
 		print "Setting up remote"
 		self.th.setup(p_type)
diff --git a/xem_rpc.py b/xem_rpc.py
index 34aab9b..6ef39e8 100644
--- a/xem_rpc.py
+++ b/xem_rpc.py
@@ -51,7 +51,7 @@ class rpc_proxy:
 
 	def _make_sk(self):
 		sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-		sk.connect((self._srv, rpc_port))
+		sk.connect(self._srv)
 		return sk
 
 	def open_socket(self, uname):
-- 
1.9.3



More information about the CRIU mailing list