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 <stefano.stabellini@xxxxxxxxxxxxx>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|