Linux Container Development
 help / color / mirror / Atom feed
From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Cc: dlezcano-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org,
	Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Subject: Re: [RFC][PATCH 0/4][user-cr]: First try at integrating LXC and USER-CR
Date: Fri, 26 Feb 2010 16:10:02 -0800	[thread overview]
Message-ID: <20100227001002.GA22965@us.ibm.com> (raw)
In-Reply-To: <4B88429B.4000701-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>

Oren Laadan [orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org] wrote:
> Suka,
>
> This is good stuff: convert restart to a library and intergate
> with LXC is excellent target.
>
> We need to give a thought to the API design and the sort of
> functionality that the library will offer. I'd prefer to get
> a better view of the whole plan before committing to any
> incremental step.
>
> For example:
>
> * what prefix will the library calls have ?  e.g. cr_checkpoint(),
> cr_restart() etc.  Could also be checkpoint_... or ckpt_... In
> any case, must be consistent and unique, and also agree with the
> library name: libcheckpoint.a and usercr.h doesn't make sense to
> me.

Agree. I have been worried about publishing an interface and getting
stuck with a bad interface. But I have also been trying to prototype
interface with LIBLXC available so did not yet spend lot of time
on the interface.

I have been meaning to add a disclaimer to usercr.h that the structures
will change without regard to backward compatibility

libcheckpoint.a looked like a reasonable name but for the header,
we already have a checkpoint.h from the kernel :-) Open to new/better
names/prefixes for the library calls.

Anyway, these names are just for the prototype and to start a discussion,
My guess is that we are not ready to publish a formal interface at
this point, but we can start moving towards that.

My current pass has been to eliminate all global references in
app_restart() and app_checkpoint() (like perror(), stderr, stdout etc).
while preserving the current behavior. Once we have an interface
that LIBLXC can use, maybe we could focus more on stabilizing
the interface ? It seemed to hard to do that with all the
globals in the code.

>
> * what arguments are really necessary in struct restart_args ? for
> example, a ->logfd is necessary, but ->logfile (pathname) is not
> (the caller should already open the file)

I have several small patches to clean this up. Was hoping to post
later today. They remove ->logfile, ->input, ->output fromt he
structures and just leave the relevant fds.

>
> * the library should provide an api to initialize the default args
> (e.g. the logfd should be -1 by default), e.g. cr_init_restart_args()
>
> * similarly, only constants and macros relevant to a caller
> should be exposed, not internal data structures or macros.
>
> * verbosity, debugging, warn and fail: currently that can be
> configurable to some extent; but we should never impose on the
> caller a perror() - instead the caller should pass FILE * for
> stdout and stderr (if NULL - the library will keep silent).

Yes, my current patchset uses a restart_args->ulogfd for the
user-space error messages. The restart-main.c sets this field
to fileno(stderr).

>
> * probably makes sense to add interface to freeze a process tree
> identified by its root pid, and thaw a process tree (or a cgroup).

True. For the near-term, LIBLXC has a way to freeze/thaw the containers

>
> * does the mnt-ns manipulation belong to cr_restart() ?  perhaps
> make it a separate api in the library ?

Good point. We need to think about that.

>
> * we need to change the way restart detects errors and cleans up
> from relying on signals to, e.g. on pipes. I've been wanting to
> do this for the longest time, and it will eliminate most (if not
> all) of the global variables.

Ok.

  parent reply	other threads:[~2010-02-27  0:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24  8:34 [RFC][PATCH 0/4][user-cr]: First try at integrating LXC and USER-CR Sukadev Bhattiprolu
     [not found] ` <20100224083452.GB18758-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-02-24  8:35   ` [PATCH 1/4][user-cr] Move common definitions to restart.h Sukadev Bhattiprolu
     [not found]     ` <20100224083534.GC18758-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-03  0:04       ` [PATCH] c/r: fix regression (in "fix scheduling in atomic while restoring ipc shm") Oren Laadan
     [not found]         ` <1267574649-14269-1-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-03-03 15:38           ` Serge E. Hallyn
2010-02-24  8:36   ` [PATCH 2/4][user-cr] Rename struct args to struct restart_args Sukadev Bhattiprolu
2010-02-24  8:36   ` [PATCH 3/4][user-cr] Move main() in restart.c to restart-main.c Sukadev Bhattiprolu
2010-02-24  8:37   ` [PATCH 4/4][user-cr] Rename libeclone.a to libcheckpoint.a Sukadev Bhattiprolu
     [not found]     ` <20100224083726.GF18758-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-02-24 15:19       ` Serge E. Hallyn
     [not found]         ` <20100224151919.GB6425-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-02-24 22:26           ` Sukadev Bhattiprolu
2010-02-26 21:53       ` Oren Laadan
     [not found]         ` <4B8842C8.9080707-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-02-27  1:44           ` Sukadev Bhattiprolu
2010-02-24 15:15   ` [RFC][PATCH 0/4][user-cr]: First try at integrating LXC and USER-CR Serge E. Hallyn
2010-02-24 18:25   ` Cedric Le Goater
2010-02-26 21:52   ` Oren Laadan
     [not found]     ` <4B88429B.4000701-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-02-27  0:10       ` Sukadev Bhattiprolu [this message]
     [not found]         ` <20100227001002.GA22965-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-02-27  2:14           ` Oren Laadan
2010-03-01 21:22   ` Oren Laadan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100227001002.GA22965@us.ibm.com \
    --to=sukadev-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=dlezcano-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org \
    --cc=orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox