[CRIU] Process Migration using Sockets v3 - Patch 1/2

Pavel Emelyanov xemul at parallels.com
Mon Nov 23 01:41:13 PST 2015


On 11/19/2015 05:41 PM, Rodrigo Bruno wrote:

>> I would also ask you to write tests for proxy-cache thing, otherwise
>> chances that it will be occasionally broken increase drastically.
> 
> Okey. Is it okey for the tests to be all local (i.e., run all daemons
> locally)?

Sure!


>>> +int read_remote_image_connection(char* snapshot_id, char* path)
>>> +{
>>> +	int error;
>>> +	int sockfd = setup_UNIX_client_socket(READ_IMG_PATH);
>>
>> Here (and below) the paths to proxy-cache sockets are hard-coded. Is it going
>> to stay forever?
> 
> You are referring to the defines in img-remote.h, right? Maybe it should be better
> to allow the user to modify the paths but also provide defaults if the user does
> not provide them. Do you agree?

Yup, some defaults definitely make sense, but need some way to specify them
by hands. This will be used when doing several migrations in parallel.


>>> diff --git a/page-read.c b/page-read.c
>>> index 832c057..40c38bc 100644
>>> --- a/page-read.c
>>> +++ b/page-read.c
>>> @@ -195,9 +204,24 @@ static int try_open_parent(int dfd, int pid, struct page_read *pr, int pr_flags)
>>>  	int pfd, ret;
>>>  	struct page_read *parent = NULL;
>>>  
>>> -	pfd = openat(dfd, CR_PARENT_LINK, O_RDONLY);
>>> -	if (pfd < 0 && errno == ENOENT)
>>> -		goto out;
>>> +	if(opts.remote) {
>>> +		/* Note: we are replacing a real directory FD for a snapshot_id
>>> +                 * index. Since we need the parent of the current snapshot_id,
>>> +                 * we want the current snapshot_id index minus one.
>>
>> Is it 100% guaranteed that parent image is -1 from the current one?
> 
> Yes (unless there is a bug...). Snapshots are taken sequentially and the ids are
> also stored one after another.

OK


--Pavel


More information about the CRIU mailing list