From: Ewan Mellor Subject: Re: [PATCH] [xendomains] Make absolutely certain xendomains won't start a domain that has failed to restore Date: Thu, 7 Dec 2006 12:23:46 +0000 Message-ID: <20061207122346.GG30076@leeni.uk.xensource.com> References: <1165444849.11456.12.camel@puck.indigologic.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1165444849.11456.12.camel@puck.indigologic.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Hugh Brock Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Wed, Dec 06, 2006 at 05:40:49PM -0500, Hugh Brock wrote: > In testing the xendomains init script, we have discovered a condition in > which xm restore will complete successfully, but the xendomains > script nonetheless attempts to create from scratch. Any domain > with an entry in XENDOMAINS_AUTO that was also automatically paused on > shutdown is vulnerable to this problem. We believe the sequence of > events is as follows: > > 1. xm restore guest1 > 2. xend pauses guest1 and waits N seconds for hotplug to complete > 3. hotplug does not complete (for some reason), so xm restore finishes, > but guest1 is still in paused state (not destroyed after failure) > 4. xm create guest1 is run > 5. original paused guest1 grabs the hotplug devices from the new guest1 > 6. original guest1 is now running > 7. new guest1 is waiting for devices which were stolen > > This results in a running guest1 and a paused guest1; if an operator > then attempts to unpause the paused guest1, storage corruption or worse > could result. > > This patch checks the contents of XENDOMAINS_SAVE before the restore > process begins, and prevents xendomains from attempting to start any > domain that appears there, whether the domain started successfully or > not. > > Signed off by: Hugh Brock Applied, thanks Hugh. Ewan.