Linux Container Development
 help / color / mirror / Atom feed
From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: dlezcano-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org
Cc: Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	clg-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org
Subject: [RFC][PATCH 0/5][lxc]: Link with USERCR
Date: Thu, 18 Mar 2010 23:39:12 -0700	[thread overview]
Message-ID: <20100319063912.GA25732@us.ibm.com> (raw)


Link lxc_checkpoint, lxc_restart with USERCR[2]

Following set of patches, when applied to LXC 0.6.5 and built with
USERCR, enable lxc_checkpoint and lxc_restart of some simple containers.

TODO:
	- For simplicity, this patchset currently links *statically* with
	  USERCR. We should eventually build checkpoint.o and restart.o in
	  USERCR as shared objects and link lxc_checkpoint/lxc_restart with
	  these shared objects and liblxc.so. (This also required rebuilding
	  lxc-execute statically, so lxc_checkpoint can communicate with
	  lxc-execute to get the root-pid of container).

	- Determine if lxc_checkpoint needs a --container option (see
	  TODOs in src/lxc/checkpoint.c)

	- This patchset was tested using lxc-macvlan.conf. But for the VNC
	  server testing I ran into a problem with lxc-macvlan.conf. I
	  switched to 'lxc-no-netns.conf' and was able to C/R the VNC server.
	  I have not debugged the problem with VNC and lxc-macvlan.conf.

	- 'global_send_sigint' is still a global variable in USERCR. We need
	  to define a better interface to expose its functionality to callers
	  of app_restart().

	- Choose better names and API for USERCR :-)

Changelog[v2]: 
	(Based on feedback from Oren Laadan, Serge Hallyn, Daniel Lezcano
	and Cedric Le Goater)

	- Rather than drop --directory option to lxc_checkpoint/lxc_restart
	  add a new option (--image).

	- Integrate lxc_checkpoint to work with USERCR

	- USERCR renamed usercr.h to "app-checkpoint.h"

	- USERCR does not create/install libcheckpoint.a and usercr.h for now.
	  So link directly with app-checkpoint.h, restart.o and checkpoint.o

	- USERCR renames the interfaces to app_checkpoint() and app_restart()
	  'struct app_checkpoint_args' 'struct app_restart_args'.
	  
USAGE:

1. Build USERCR

	$ cd /root

	$ git-clone git://git.ncl.cs.columbia.edu/pub/git/user-cr.git user-cr

	$ git-checkout ckpt-v20 
	
	# Apply patches in the following set:

	# https://lists.linux-foundation.org/pipermail/containers/2010-March/023793.html

	$ cd /root/user-cr

	$ make 

		This should create restart.o and checkpoint.o

2. Build/install lxc_checkpoint and lxc_restart

	# Do normal LXC build/install of 0.6.5.

	# Then replace 'lxc-execute', 'lxc-checkpoint', 'lxc-restart' with
	# new version. i.e Apply attached patches and:

	$ cd src/lxc

	$ USERCR=/root/user-cr \
		make -f Makefile2 lxc_checkpoint lxc_restart lxc_execute

	$ cp lxc_checkpoint lxc_restart lxc-execute  /usr/local/bin

3. Checkpoint/restart a simple LXC container

	$ lxc-execute --name foo --rcfile lxc-no-netns.conf -- /bin/sleep 1000

	$ lxc-freeze --name foo

	$ lxc-checkpoint --name foo --image /root/lxc-foo.ckpt

	$ lxc-unfreeze --name foo

	$ lxc-stop --name foo

	$ lxc-restart --name foo --image /root/lxc-foo.ckpt

4. Checkpoint/restart other LXC containers such as:

	- a file-io session (see run-fileio1 in cr-tests[1])

	- process-tree (see run-ptree1 in cr-tests[1])

	- A vi session inside a VNC Server using "twm". i.e

		$ cat /root/.vnc/xstartup
		#!/bin/sh

		xsetroot -solid grey
		vncconfig -iconic &
		xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
		twm &

		$ lxc-execute --name foo --rcfile lxc-no-netns.conf -- \
			/usr/bin/vncserver :1

		$ vncviewer :1

			# Open a vi session

		$ lxc-freeze --name foo 

			etc

[1]: cr-tests:	git://git.sr71.net/~hallyn/cr_tests.git
[2]: USERCR: git://git.ncl.cs.columbia.edu/pub/git/user-cr.git

Signed-off-by: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>

             reply	other threads:[~2010-03-19  6:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-19  6:39 Sukadev Bhattiprolu [this message]
     [not found] ` <20100319063912.GA25732-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-19  6:40   ` [PATCH 1/5][lxc] Enable static linking of some lxc binaries Sukadev Bhattiprolu
     [not found]     ` <20100319064024.GB25732-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-22 14:44       ` Daniel Lezcano
2010-03-19  6:40   ` [PATCH 2/5][lxc] lxc_restart: Add --image option Sukadev Bhattiprolu
     [not found]     ` <20100319064046.GC25732-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-22 14:45       ` Daniel Lezcano
     [not found]         ` <4BA78276.2040308-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2010-03-24 19:48           ` Sukadev Bhattiprolu
     [not found]             ` <20100324194851.GD20031-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-24 20:53               ` Daniel Lezcano
2010-03-19  6:41   ` [PATCH 3/5][lxc] lxc_checkpoint: " Sukadev Bhattiprolu
2010-03-19  6:41   ` [PATCH 4/5][lxc] Hook up lxc_restart() with app_restart() Sukadev Bhattiprolu
     [not found]     ` <20100319064121.GE25732-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-22 14:48       ` Daniel Lezcano
2010-03-19  6:41   ` [PATCH 5/5][lxc] Hook up lxc_checkpoint() with app_checkpoint() Sukadev Bhattiprolu
     [not found]     ` <20100319064141.GF25732-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-22 14:44       ` Daniel Lezcano
     [not found]         ` <4BA78262.6050109-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2010-03-24 19:35           ` Sukadev Bhattiprolu
     [not found]             ` <20100324193537.GB20031-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-24 20:51               ` Daniel Lezcano
2010-03-19 10:44   ` [RFC][PATCH 0/5][lxc]: Link with USERCR Michel Normand
2010-03-24 19:22     ` Sukadev Bhattiprolu
2010-03-22 14:45   ` Daniel Lezcano
     [not found]     ` <4BA7826D.10706-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2010-03-24 19:27       ` Oren Laadan
2010-03-24 19:47       ` Sukadev Bhattiprolu
     [not found]         ` <20100324194744.GC20031-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-24 20:52           ` Daniel Lezcano

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=20100319063912.GA25732@us.ibm.com \
    --to=sukadev-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
    --cc=clg-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=dlezcano-NmTC/0ZBporQT0dZR+AlfA@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