Re: [lxc-devel] [PATCH 2/2] Must unfreeze while stopping container

2010-07-12 Thread Daniel Lezcano
On 07/10/2010 04:52 AM, Sukadev Bhattiprolu wrote:

[ ... ]
 + if (!answer.ret) {
 + ret = lxc_unfreeze(handler-name);
 + if (!ret)
 + return 0;


[ ... ]

gcc -DHAVE_CONFIG_H -I. -I../../src -fPIC -DPIC -I../../src -g -O2 -Wall 
-MT liblxc_so-stop.o -MD -MP -MF .deps/liblxc_so-stop.Tpo -c -o 
liblxc_so-stop.o `test -f 'stop.c' || echo './'`stop.c
stop.c: In function ‘lxc_stop_callback’:
stop.c:87: warning: implicit declaration of function ‘lxc_unfreeze’

It looks like #include lxc.h is missing.

Please in the future check you are not introducing warnings.

Thanks
-- Daniel

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


[lxc-devel] [PATCH 2/2] Must unfreeze while stopping container

2010-07-09 Thread Sukadev Bhattiprolu

From: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com
Subject: [PATCH 2/2] Must unfreeze while stopping container

As pointed out by Dan Smith, when a container is being stopped, it must
also be unfrozen after posting the SIGKILL. Otherwise if the container
is frozen when the SIGKILL is posted, the SIGKILL will remain pending
and the lxc-stop command will block until lxc-unfreeze is explicitly
called).

(lxc-stop waits for the container to exit and close the socket but since
the container is frozen, lxc-stop will block).

Signed-off-by: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com
Acked-by: Matt Helsley matth...@us.ibm.com
Acked-by: Dan Smith da...@us.ibm.com
---
 src/lxc/stop.c |   10 --
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/lxc/stop.c b/src/lxc/stop.c
index b751af5..f441e46 100644
--- a/src/lxc/stop.c
+++ b/src/lxc/stop.c
@@ -83,8 +83,14 @@ extern int lxc_stop_callback(int fd, struct lxc_request 
*request,
int ret;
 
answer.ret = kill(handler-pid, SIGKILL);
-   if (!answer.ret)
-   return 0;
+   if (!answer.ret) {
+   ret = lxc_unfreeze(handler-name);
+   if (!ret)
+   return 0;
+
+   ERROR(failed to unfreeze container);
+   answer.ret = ret;
+   }
 
ret = send(fd, answer, sizeof(answer), 0);
if (ret  0) {
-- 
1.6.0.4


--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel