public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vfio: Set PCI_DEV_FLAGS_ASSIGNED when assigning device to guest
@ 2014-01-30 17:24 Bandan Das
  2014-01-30 17:33 ` Alex Williamson
  0 siblings, 1 reply; 6+ messages in thread
From: Bandan Das @ 2014-01-30 17:24 UTC (permalink / raw)
  To: kvm; +Cc: Alex Williamson


Some drivers such as ixgbe rely on pci_vfs_assigned() to prevent
disabling sr-iov when vfs are still assigned during hotplug
event or module removal. Set and unset PCI_DEV_FLAGS_ASSIGNED
appropriately

Signed-off-by: Bandan Das <bsd@redhat.com>
---
 drivers/vfio/pci/vfio_pci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index 7ba0424..7cc7ed6 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/pci/vfio_pci.c
@@ -90,6 +90,7 @@ static int vfio_pci_enable(struct vfio_pci_device *vdev)
 		vdev->has_vga = true;
 #endif
 
+	pdev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED;
 	return 0;
 }
 
@@ -149,6 +150,7 @@ static void vfio_pci_disable(struct vfio_pci_device *vdev)
 				__func__, dev_name(&pdev->dev), ret);
 	}
 
+	pdev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED;
 	pci_restore_state(pdev);
 }
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-01-30 20:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-30 17:24 [PATCH] vfio: Set PCI_DEV_FLAGS_ASSIGNED when assigning device to guest Bandan Das
2014-01-30 17:33 ` Alex Williamson
2014-01-30 17:36   ` Alex Williamson
2014-01-30 18:06     ` Bandan Das
2014-01-30 18:38       ` Alex Williamson
2014-01-30 20:10         ` Bandan Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox