[CRIU] [PATCH] crtools: add addr string to opts.

Ruslan Kuprieiev kupruser at gmail.com
Thu Aug 8 13:34:32 EDT 2013


On 08.08.2013 19:53, Pavel Emelyanov wrote:
> On 08/08/2013 08:44 PM, Ruslan Kuprieiev wrote:
>> Hello!
>>
>> Added char * addr field to struct cr_options. It will be used as socket
>> address in cr_service(). addr is properly converted into ps_addr if
>> "page-server" command is set.
>>
>
> You obviously didn't check this change, as ps_addr thing in your
> patch if only initialized for page-server action, while can also
> be used on dump --page-server combination.
>
> Thanks,
> Pavel
Sorry.
Here is another one.

-- 
Signed-off-by: Ruslan Kuprieiev kupruser at gmail.com

-------------- next part --------------
diff --git a/crtools.c b/crtools.c
index 51d188a..6a9d430 100644
--- a/crtools.c
+++ b/crtools.c
@@ -235,9 +235,14 @@ int main(int argc, char *argv[])
 			opts.use_page_server = true;
 			break;
 		case 51:
-			if (!inet_aton(optarg, &opts.ps_addr.sin_addr)) {
-				pr_perror("Bad address");
-				return -1;
+			if (opts.use_page_server) {
+				if (!inet_aton(optarg,
+						&opts.ps_addr.sin_addr)) {
+					pr_perror("Bad address");
+					return -1;
+				}
+			} else {
+				opts.addr = strdup(optarg);
 			}
 			break;
 		case 52:
diff --git a/include/crtools.h b/include/crtools.h
index 81e89e1..da832f2 100644
--- a/include/crtools.h
+++ b/include/crtools.h
@@ -41,6 +41,7 @@ struct cr_options {
 	struct list_head	scripts;
 	bool			use_page_server;
 	struct sockaddr_in	ps_addr;
+	char			*addr;
 	bool			track_mem;
 	char			*img_parent;
 };

Signed-off-by: Ruslan Kuprieiev kupruser at gmail.com


More information about the CRIU mailing list