aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-10-05 16:46:00 +0200
committerFlorin Coras <florin.coras@gmail.com>2018-10-05 18:02:13 +0000
commitb7620fdfd50d6d03a366a78c6bd1e51572bf8f67 (patch)
tree03f0ece4094e15695bc095e515433a7c762f8765 /src/vlib
parent16de39e1a1d922d42b33dcd1b33c3716e3f766f6 (diff)
vfio: don't display error if no pci devices are assigned to container
Change-Id: I21429ce084cfd39af6a9997b4c1e459f5a6ef672 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/linux/vfio.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vlib/linux/vfio.c b/src/vlib/linux/vfio.c
index 53eed8bfbe9..02262719e82 100644
--- a/src/vlib/linux/vfio.c
+++ b/src/vlib/linux/vfio.c
@@ -35,7 +35,7 @@
linux_vfio_main_t vfio_main;
static int
-map_regions (vlib_main_t * vm, int fd)
+vfio_map_regions (vlib_main_t * vm, int fd)
{
vlib_physmem_main_t *vpm = &physmem_main;
linux_vfio_main_t *lvm = &vfio_main;
@@ -58,7 +58,8 @@ map_regions (vlib_main_t * vm, int fd)
vlib_log_debug (lvm->log_default, "map DMA va:0x%lx iova:%lx "
"size:0x%lx", dm.vaddr, dm.iova, dm.size);
- if ((rv = ioctl (fd, VFIO_IOMMU_MAP_DMA, &dm)))
+ if ((rv = ioctl (fd, VFIO_IOMMU_MAP_DMA, &dm)) &&
+ errno != EINVAL)
{
vlib_log_err (lvm->log_default, "map DMA va:0x%lx iova:%lx "
"size:0x%lx failed, error %s (errno %d)",
@@ -78,7 +79,7 @@ linux_vfio_dma_map_regions (vlib_main_t * vm)
linux_vfio_main_t *lvm = &vfio_main;
if (lvm->container_fd != -1)
- map_regions (vm, lvm->container_fd);
+ vfio_map_regions (vm, lvm->container_fd);
}
static linux_pci_vfio_iommu_group_t *