[CRIU] [PATCH 1/3] Process Migration using Sockets (Rodrigo Bruno)

Pavel Emelyanov xemul at virtuozzo.com
Thu Feb 9 00:31:45 PST 2017


Sorry for long delay (again) in response...

I'm ready to merge the patches into criu-dev, and later, when we have
all this functionality tested by zdtm.py and code improved, I will merge
the code into master. But in order to facilitate the 1st merging (into
criu-dev branch) happen, can you do some cosmetic changes (mostly text 
fixes and splits)?

Comments are inline.

Later (after merge) I'll send more comments about what should be done on
top of this set to make criu-dev -> master merge.

> @@ -105,6 +105,7 @@ extern bool img_common_magic;
>  #define O_DUMP		(O_WRONLY | O_CREAT | O_TRUNC)
>  #define O_SHOW		(O_RDONLY | O_NOBUF)
>  #define O_RSTR		(O_RDONLY)
> +#define O_FORCE_LOCAL	(O_SYNC)

Please, send the O_FORCE_LOCAL flag and image descs marked with it (3 hunks)
as separate patch.


> @@ -501,7 +528,11 @@ static int init_pagemaps(struct page_read *pr)
>  	off_t fsize;
>  	int nr_pmes, nr_realloc;
> 
> -	fsize = img_raw_size(pr->pmi);
> +	if (!opts.remote)
> +		fsize = img_raw_size(pr->pmi);
> +	else
> +		fsize = 1024; /*FIXME*/

Please, send the O_FORCE_LOCAL flag and image descs marked with it (3 hunks)
as separate patch.

> @@ -224,22 +229,8 @@ int restore_sk_queue(int fd, unsigned int peer_id)
>  		 * boundaries messages should be saved.
>  		 */
> 
> -		buf = xmalloc(entry->length);
> -		if (buf ==NULL)
> -			goto err;
> -
> -		if (lseek(img_raw_fd(img), pkt->img_off, SEEK_SET) == -1) {
> -			pr_perror("lseek() failed");
> -			xfree(buf);
> -			goto err;
> -		}
> -		if (read_img_buf(img, buf, entry->length) != 1) {
> -			xfree(buf);
> -			goto err;
> -		}
> -
> -		ret = write(fd, buf, entry->length);
> -		xfree(buf);
> +		ret = write(fd, pkt->data, entry->length);
> +		xfree(pkt->data);

Please, send the restore_sk_queue() rework as separate patch.

-- Pavel


More information about the CRIU mailing list