From: Konrad Rzeszutek Wilk Date: Wed, 4 Jan 2012 20:11:02 +0000 (-0500) Subject: xen/pciback: Fix "device has been assigned to X domain!" warning X-Git-Tag: v2.6.39-400.9.0~595^2~14^2~6 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f509e85f7178c7c2e30bddf5778ad278ac0fbd91;p=users%2Fjedix%2Flinux-maple.git xen/pciback: Fix "device has been assigned to X domain!" warning The full warning is: "pciback 0000:05:00.0: device has been assigned to 2 domain! Over-writting the ownership, but beware." which is correct - the previous domain that was using the device forgot to unregister the ownership. This patch fixes this by calling the unregister ownership function when the PCI device is relinquished from the guest domain. Signed-off-by: Konrad Rzeszutek Wilk --- diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c index 8f06e1ed028c..6d270306f3a0 100644 --- a/drivers/xen/xen-pciback/pci_stub.c +++ b/drivers/xen/xen-pciback/pci_stub.c @@ -234,6 +234,8 @@ void pcistub_put_pci_dev(struct pci_dev *dev) xen_pcibk_config_free_dyn_fields(found_psdev->dev); xen_pcibk_config_reset_dev(found_psdev->dev); + xen_unregister_device_domain_owner(found_psdev->dev); + spin_lock_irqsave(&found_psdev->lock, flags); found_psdev->pdev = NULL; spin_unlock_irqrestore(&found_psdev->lock, flags);