diff mbox

[3/3] vfio: remove checking duplicated vfio device

Message ID 1505156192-18994-4-git-send-email-wexu@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Xu Sept. 11, 2017, 6:56 p.m. UTC
From: Wei Xu <wexu@redhat.com>

This has been done when introducing 'vfio_lookup_as()'
patch as a side work to reuse the loop.

Signed-off-by: Wei Xu <wexu@redhat.com>
---
 hw/vfio/pci.c | 9 ---------
 1 file changed, 9 deletions(-)
diff mbox

Patch

diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 856cefd..d78f756 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2632,7 +2632,6 @@  static void vfio_unregister_req_notifier(VFIOPCIDevice *vdev)
 static void vfio_realize(PCIDevice *pdev, Error **errp)
 {
     VFIOPCIDevice *vdev = DO_UPCAST(VFIOPCIDevice, pdev, pdev);
-    VFIODevice *vbasedev_iter;
     VFIOGroup *group;
     char *tmp, group_path[PATH_MAX], *group_name;
     Error *err = NULL;
@@ -2697,14 +2696,6 @@  static void vfio_realize(PCIDevice *pdev, Error **errp)
         goto error;
     }
 
-    QLIST_FOREACH(vbasedev_iter, &group->device_list, next) {
-        if (strcmp(vbasedev_iter->name, vdev->vbasedev.name) == 0) {
-            error_setg(errp, "device is already attached");
-            vfio_put_group(group);
-            goto error;
-        }
-    }
-
     ret = vfio_get_device(group, vdev->vbasedev.name, &vdev->vbasedev, errp);
     if (ret) {
         vfio_put_group(group);