From: Ian Campbell Subject: Re: [PATCH 17/19] libxl: suspend: Fix suspend wait corner cases Date: Fri, 14 Mar 2014 10:20:22 +0000 Message-ID: <1394792422.6442.1.camel@kazak.uk.xensource.com> References: <1393945016-1417-1-git-send-email-ian.jackson@eu.citrix.com> <1393945016-1417-18-git-send-email-ian.jackson@eu.citrix.com> <1394731134.16364.31.camel@kazak.uk.xensource.com> <21281.63968.101032.554631@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21281.63968.101032.554631@mariner.uk.xensource.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 Jackson Cc: Shriram Rajagopalan , xen-devel@lists.xensource.com, Lai Jiangshan , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Thu, 2014-03-13 at 18:33 +0000, Ian Jackson wrote: > Ian Campbell writes ("Re: [PATCH 17/19] libxl: suspend: Fix suspend wait corner cases"): > > On Tue, 2014-03-04 at 14:56 +0000, Ian Jackson wrote: > > > + if (ret < 0) { > > > + LOGE(ERROR, "unable to check for status of guest %"PRId32"", domid); > > > + goto err; > > > + domain_suspend_common_failed(egc, dss); > > > > You don't want this here. > > Indeed I don't. > > > > + if (!(ret == 1 && info.domain == domid)) { > > > + LOGE(ERROR, "guest %"PRId32" we were suspending has been destroyed", > > > + domid); > > > > Is there an (unlikely) race here where a new domain gets created with > > the same domid? Not that I have any suggestion what to do about that... > > If domids are reused within the lifetime of the libxc/libxl code > managing the domain, the whole edifice is unsafe. AFAICT this is a > fundamental problem which cannot be avoided in any toolstack > which is capable of concurrently issuing hypercalls (specifically, > destroying domains). Yes. Oh well. With the unwanted dmain_suspend call removed: Acked-by: Ian Campbell Ian.