From: Stefano Stabellini Subject: Re: xl: pci completion error Date: Wed, 6 Oct 2010 14:54:05 +0100 Message-ID: References: <4CAB0E9A.5050507@gmail.com> <4CAC74DD.3030703@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Return-path: In-Reply-To: <4CAC74DD.3030703@gmail.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: Sergey Tovpeko Cc: "xen-devel@lists.xensource.com" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Wed, 6 Oct 2010, Sergey Tovpeko wrote: > The guest is Windows XP sp2 32 bit. > > When I do pci hot-unplug on the fly > xl pci-detach 11:0b.0 > the guest detaches the pci card correctly with 'pci-removed' signal, but > on the shutdown, it doesn't. > > In the code the flow is the following: > qemu-dm receives the 'pci-rem' command and sends the SCI interrupt to > the guest. I think guest should catch this interrupt and write to the > magic ACPI port that causes qemu-dm send 'pci-removed' signal. > > On guest shutdown, libxl sends 'pci-rem' command to qemu-dm and waits > for the answer. > I suppose, by the time 'pci-rem' signal my guest have finished its work, > and doesn't react on SCI interrupt. As a result libxl doesn't receive > pci-removed signal. > > It's my observation. > We could probably benefit from a boolean "force" parameter to do_pci_remove and libxl_device_pci_remove, that would cause do_pci_remove not to return if libxl__wait_for_device_model returns error. Of course libxl_device_pci_remove would be called with force=1 by libxl_device_pci_shutdown. Gianni, what do you think?