Re: [libvirt] [PATCH] lxc: suspend/resume support

2009-09-22 Thread Daniel P. Berrange
On Mon, Sep 21, 2009 at 11:33:12PM +0900, Ryota Ozaki wrote: > OK, fixed the two parts. Thanks for the review! > > And the fixed patch is here! > ozaki-r > > PS: git rebase works well ;-) > > > From abe363de43f5053a01593de6e634f654525cd8b4 Mon Sep 17 00:00:00 2001 > From: Ryota Ozaki > Date:

Re: [libvirt] [PATCH] lxc: suspend/resume support

2009-09-21 Thread Ryota Ozaki
On Mon, Sep 21, 2009 at 9:05 PM, Daniel P. Berrange wrote: > On Thu, Sep 17, 2009 at 12:42:08AM +0900, Ryota Ozaki wrote: >> +static int lxcDomainSuspend(virDomainPtr dom) >> +{ >> +    lxc_driver_t *driver = dom->conn->privateData; >> +    virDomainObjPtr vm; >> +    virDomainEventPtr event = NUL

Re: [libvirt] [PATCH] lxc: suspend/resume support

2009-09-21 Thread Daniel P. Berrange
On Thu, Sep 17, 2009 at 12:42:08AM +0900, Ryota Ozaki wrote: > +static int lxcDomainSuspend(virDomainPtr dom) > +{ > +lxc_driver_t *driver = dom->conn->privateData; > +virDomainObjPtr vm; > +virDomainEventPtr event = NULL; > +int ret = -1; > + > +lxcDriverLock(driver); > +vm

Re: [libvirt] [PATCH] lxc: suspend/resume support

2009-09-16 Thread Ryota Ozaki
Hi I've updated the patch with Chris' suggestions. The change includes - not wait for long period in the case that the freezing is complete quickly without increasing the number of polling in the case the freezing is slow or never complete - add event notifications Thanks, ozaki-r >From 8

Re: [libvirt] [PATCH] lxc: suspend/resume support

2009-09-16 Thread Ryota Ozaki
On Wed, Sep 16, 2009 at 9:41 PM, Ryota Ozaki wrote: > Hi Chris, > > On Wed, Sep 16, 2009 at 8:15 PM, Chris Lalancette wrote: >> It looks relatively good, but one suggestion and two missing pieces: (snip) >> Suggestion: it might be better to sleep for shorter periods of time here in a >> loop.  Th

Re: [libvirt] [PATCH] lxc: suspend/resume support

2009-09-16 Thread Ryota Ozaki
Hi Chris, On Wed, Sep 16, 2009 at 8:15 PM, Chris Lalancette wrote: > It looks relatively good, but one suggestion and two missing pieces: > > Ryota Ozaki wrote: > > > >> diff --git a/src/lxc_driver.c b/src/lxc_driver.c >> index 0ec1e92..2399d98 100644 >> --- a/src/lxc_driver.c >> +++ b/src/lxc_d

Re: [libvirt] [PATCH] lxc: suspend/resume support

2009-09-16 Thread Chris Lalancette
It looks relatively good, but one suggestion and two missing pieces: Ryota Ozaki wrote: > diff --git a/src/lxc_driver.c b/src/lxc_driver.c > index 0ec1e92..2399d98 100644 > --- a/src/lxc_driver.c > +++ b/src/lxc_driver.c > @@ -1862,6 +1862,188 @@ static char *lxcGetHostname (virConnectPtr conn)

[libvirt] [PATCH] lxc: suspend/resume support

2009-09-16 Thread Ryota Ozaki
Hi, This patch implements suspend/resume functions for LXC using cgroups freezer subsystem. The use of freezer is quite simple and well documented in Documentation/cgroups/freezer-subsystem.txt. The patch just uses it as it is. That is like: # freeze the container echo FROZEN > /target/container