[CRIU] [PATCH 3/4] [v4] mount: add support for external block devices

Pavel Emelyanov xemul at virtuozzo.com
Fri May 6 10:21:58 PDT 2016


>>> @@ -878,9 +873,12 @@ usage:
>>>  "                        force criu to (try to) dump/restore these filesystem's\n"
>>>  "                        mountpoints even if fs is not supported.\n"
>>>  "  --external RES        dump objects from this list as external resources:\n"
>>> -"                        Formats of RES:\n"
>>> +"                        Formats of RES on dump:\n"
>>>  "                            tty[rdev:dev]\n"
>>>  "                            file[mnt_id:inode]\n"
>>> +"                            dev[maj:min]:VAL\n"
>>> +"                        Formats of RES on restore:\n"
>>> +"                            VAL:DEVPATH\n"
>>
>> DEVPATH? This looks like --external for restore is device-only feature, while
>> it should not be such.
> 
> Currently VAL is used only with the dev[maj:min] key, so here is only
> DEVPATH now. In a future we can add new key:value pairs.

OK, but let's make this option have the same syntax for restore as it is for
dump. E.g. --external dev[VAL]:DEVPATH or smth like this.

>>> @@ -487,15 +489,33 @@ static void mnt_tree_show(struct mount_info *tree, int off)
>>>  static int try_resolve_ext_mount(struct mount_info *info)
>>>  {
>>>  	struct ext_mount *em;
>>> +	char devstr[64];
>>>  
>>>  	em = ext_mount_lookup(info->mountpoint + 1 /* trim the . */);
>>> -	if (em == NULL)
>>> -		return -ENOTSUP;
>>> +	if (em) {
>>> +		pr_info("Found %s mapping for %s mountpoint\n",
>>> +				em->val, info->mountpoint);
>>> +		info->external = em;
>>> +		return 0;
>>> +	}
>>>  
>>> -	pr_info("Found %s mapping for %s mountpoint\n",
>>> -			em->val, info->mountpoint);
>>> -	info->external = em;
>>> -	return 0;
>>> +	snprintf(devstr, sizeof(devstr), "dev[%d/%d]",
>>> +			kdev_major(info->s_dev),  kdev_minor(info->s_dev));
>>> +
>>> +	if (info->fstype->code == FSTYPE__UNSUPPORTED) {
>>
>> Shouldn't this be FSTYE__AUTO instead?
> 
> No. It's FSTYPE__UNSUPPORTED at this moment.

Hm... Why?



More information about the CRIU mailing list