From: Ian Campbell Subject: Re: xl save but leave domain paused Date: Tue, 11 Jun 2013 11:15:54 +0100 Message-ID: <1370945754.24512.292.camel@zakaz.uk.xensource.com> References: <51A7C8BE.4050306@yahoo.co.uk> <1370356105.24512.110.camel@zakaz.uk.xensource.com> <1370814084.74351.YahooMailNeo@web171301.mail.ir2.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1370814084.74351.YahooMailNeo@web171301.mail.ir2.yahoo.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Murray Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Sun, 2013-06-09 at 22:41 +0100, Ian Murray wrote: > Thanks for reading and responding > > > > > > Does it work if you simply do the pause before the resume? Looking at > > the hypervisor side it appears that pauses are referenced counted and it > > looks (based on a cursory glance) that it will do the right thing. > > > > I tried this before and it didn't seems to work. However, it seems to working now, having repeated the exercise. > > From memory It seemed to leave the domain in either a "pss" or similar unhealthy state (I don't remember exactly). I have since discovered this may be a different issue around suspending/checkpointing using a CentOS 5.x Xen kernel and also I was working with a domain I broke because of experimentation. > > Anyway, I will spend more time testing this solution. > > >> I have looked at the corresponding xc calls but meddling with > >> those is way beyond my knowledge. Another way of looking at the problem > >> would be able to perform an xl save on a paused domain, as this would > >> achieve the same result. > > > > OOI what happens if you try that? > > As far as I remember it complained that the domain didn't respond to the suspend request. I was going to repeat the exercise but that seems like a moot point now. > > > > > >> (Against RELEASE-4.2.2) > > > > FYI any eventual patch will need to be against unstable and then > > considered separately for backporting. > > Sure. I just needed a working place to start. > > If I was to prepare a patch against unstable, would it be accepted? It seems like useful functionality to me, so subject to reviewing the actual implementation I think it more than likely would. > > > The code I ended up with was (which is what I think you expected):- Yep, minus the fprintf which I don't think is needed. > > if (leavepaused || checkpoint || rc < 0) { > if (leavepaused && ! (rc < 0)) { I think the libxl coding style would be to cuddle the ! against the bracket. > libxl_domain_pause(ctx, domid); > fprintf(stderr, "Pausing before resume\n"); > } > libxl_domain_resume(ctx, domid, 1, 0); > } > else > libxl_domain_destroy(ctx, domid, 0); > > > > > > Ian. > >