]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
hostdev: skip ACS check when using VFIO for device assignment
authorLaine Stump <laine@laine.org>
Wed, 26 Aug 2015 06:04:23 +0000 (02:04 -0400)
committerLaine Stump <laine@laine.org>
Wed, 26 Aug 2015 18:07:01 +0000 (14:07 -0400)
The ACS checks are meaningless when using the more modern VFIO driver
for device assignment since VFIO has its own more complete and exact
checks, but I didn't realize that when I added support for VFIO. This
patch eliminates the ACS check when preparing PCI devices for
assignment if VFIO is being used.

This resolves:

  https://bugzilla.redhat.com/show_bug.cgi?id=1256486

src/util/virhostdev.c

index 529753c2c17581e1783f525584416ebb5fc1b8dd..0bc51208e14b9a5f581dad71d0a0b27abea58055 100644 (file)
@@ -1,6 +1,6 @@
 /* virhostdev.c: hostdev management
  *
- * Copyright (C) 2006-2007, 2009-2013 Red Hat, Inc.
+ * Copyright (C) 2006-2007, 2009-2015 Red Hat, Inc.
  * Copyright (C) 2006 Daniel P. Berrange
  * Copyright (C) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
  *
@@ -230,7 +230,6 @@ virHostdevGetPCIHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
             virObjectUnref(list);
             return NULL;
         }
-
         if (virPCIDeviceListAdd(list, dev) < 0) {
             virPCIDeviceFree(dev);
             virObjectUnref(list);
@@ -579,7 +578,7 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr,
         struct virHostdevIsPCINodeDeviceUsedData data = {hostdev_mgr, dom_name,
                                                          usesVfio};
 
-        if (!virPCIDeviceIsAssignable(dev, strict_acs_check)) {
+        if (!usesVfio && !virPCIDeviceIsAssignable(dev, strict_acs_check)) {
             virReportError(VIR_ERR_OPERATION_INVALID,
                            _("PCI device %s is not assignable"),
                            virPCIDeviceGetName(dev));