]> xenbits.xensource.com Git - people/jgross/xen.git/commitdiff
libxl: tooling expects wrong errno
authorGrzegorz Uriasz <gorbak25@gmail.com>
Sun, 14 Jun 2020 16:17:08 +0000 (16:17 +0000)
committerWei Liu <wl@xen.org>
Fri, 26 Jun 2020 11:56:31 +0000 (11:56 +0000)
When iommu is not enabled for a given domain then pci passthrough
hypercalls such as xc_test_assign_device return EOPNOTSUPP.
The code responsible for this is in "iommu_do_domctl" inside
xen/drivers/passthrough/iommu.c
This patch fixes the error message reported by libxl when assigning
pci devices to domains without iommu.

Signed-off-by: Grzegorz Uriasz <gorbak25@gmail.com>
Tested-by: Grzegorz Uriasz <gorbak25@gmail.com>
Backport: 4.13
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Paul Durrant <paul@xen.org>
tools/libxl/libxl_pci.c

index 957ff5c8e93f2ddb3e3865b5d2e45352db5dd135..bc5843b1370136461979fc2d231356e2348c24ac 100644 (file)
@@ -1561,7 +1561,7 @@ void libxl__device_pci_add(libxl__egc *egc, uint32_t domid,
             LOGD(ERROR, domid,
                  "PCI device %04x:%02x:%02x.%u %s?",
                  pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func,
-                 errno == ENOSYS ? "cannot be assigned - no IOMMU"
+                 errno == EOPNOTSUPP ? "cannot be assigned - no IOMMU"
                  : "already assigned to a different guest");
             goto out;
         }