Re: [PATCH 18/38] C/R: core stuff

From: Alexey Dobriyan
Date: Fri May 29 2009 - 02:01:51 EST


On Thu, May 28, 2009 at 06:20:25PM -0400, Oren Laadan wrote:
> Alexey Dobriyan wrote:
> > Price in loose case is strictly bigger than price in strict case
> > because set of loose states is strict superset of set of strict cases.
>
> The code to enforce full-container approach is a *superset* of the
> code without this requirement.
>
> If you can checkpoint a full container, surely you can checkpoint a
> sub-hierarchy of processes.

No!

To checkpoint uts_ns reliably, in strict case, one doesn't even need
uts_sem.

In loose case, one needs uts_sem.

static int dump_uts_ns(struct kstate_context *ctx, struct kstate_object *obj)
{
struct uts_namespace *uts_ns = obj->o_obj;
struct kstate_image_uts_ns *i;
int rv;

i = kstate_prepare_image(KSTATE_OBJ_UTS_NS, sizeof(*i));
if (!i)
return -ENOMEM;

if (ctx->dump_live)
down_read(&uts_sem);
strncpy(i->sysname, (const char *)uts_ns->name.sysname, 64);
strncpy(i->nodename, (const char *)uts_ns->name.nodename, 64);
strncpy(i->release, (const char *)uts_ns->name.release, 64);
strncpy(i->version, (const char *)uts_ns->name.version, 64);
strncpy(i->machine, (const char *)uts_ns->name.machine, 64);
strncpy(i->domainname, (const char *)uts_ns->name.domainname, 64);
if (ctx->dump_live)
up_read(&uts_sem);

rv = kstate_write_image(ctx, i, sizeof(*i), obj);
kfree(i);
return rv;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/