[CRIU] [PATCH v2 4/8] save net device confs one by one
Pavel Emelyanov
xemul at parallels.com
Thu Sep 25 22:54:43 PDT 2014
On 09/25/2014 12:00 PM, Pavel Tikhomirov wrote:
> +static int ipv4_conf_op(char *dir, int *conf, int op)
> +{
> + int ret;
> + int i;
> +
> + for (i = 0; devconfs[i]; i++) {
> + char path[PATH_MAX];
> + struct sysctl_req req[2];
> +
> + snprintf(path, sizeof(path), "%s/%s", dir, devconfs[i]);
> +
> + req[0].name = path;
> + req[0].arg = &conf[i];
> + req[0].type = CTL_32;
> + req[1].name = NULL;
> +
> + ret = sysctl_op(req, op);
Sysctl-s can be read/written in batches. Look at ipc_sysctl_req().
> + if (ret < 0) {
> + pr_err("Failed to read %s/%s\n", dir, devconfs[i]);
> + return -1;
> + }
> + }
> +
> + return 0;
> +}
> +
More information about the CRIU
mailing list