From: Ian Campbell Subject: Re: [PATCH 2/2] libxl: Multi-device passthrough coldplug: do not wait for unstarted guest Date: Wed, 23 Feb 2011 16:42:06 +0000 Message-ID: <1298479326.16356.11442.camel@zakaz.uk.xensource.com> References: <1298478078-20038-1-git-send-email-ian.jackson@eu.citrix.com> <1298478078-20038-2-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: "xen-devel@lists.xensource.com" , Ian Jackson List-Id: xen-devel@lists.xenproject.org On Wed, 2011-02-23 at 16:25 +0000, Stefano Stabellini wrote: > On Wed, 23 Feb 2011, Ian Jackson wrote: > > When doing a PCI passthrough, the code checks to see whether there is > > an existing backend directory in xenstore with a nonzero "num_devs". > > If there isn't, it creates the backend directory with just the > > required device. > > > > If there is, it would assume that it was doing hotplug. If doing > > hotplug, it needs to set the "state" node in xenstore to "7" > > (reconfiguring) and thus avoid racing with the backend needs to wait > > for the backend to be "4" (connected). > > > > However during guest creation, the presence of "num_devs" doesn't > > necessarily mean hotplug. If we are still creating the initial > > xenstore setup (ie, adding devices as a subroutine of domain > > creation), we can just write the new devices to xenstore. So do that. > > > > This involves adding a new parameter "starting", indicating that we > > are still in domain creation, to libxl_device_pci_add_xenstore (a > > misnamed internal function) and its callers. Its callers include > > libxl_device_pci_add which we therefore split into an internal version > > with the new parameter, and an external version used only for hotplug > > by libxl-using applications. > > > > > nice and simple > > Acked-by: Stefano Stabellini Yep, looks good: Acked-by: Ian Campbell