vfio: open container at startup rather than during init
authorAnatoly Burakov <anatoly.burakov@intel.com>
Wed, 18 Jun 2014 15:07:16 +0000 (16:07 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 18 Jun 2014 22:57:51 +0000 (00:57 +0200)
commitb841b883465f7c6b118447e230dd1ec767272cc3
tree5af2b47ce013f5995016bc06fb588acbd01286ef
parent3056abfb273c0b12f307a6b2398b4217577c3d40
vfio: open container at startup rather than during init

Currently, VFIO only checks for being able to access the /dev/vfio
directory when initializing VFIO, deferring actual VFIO container
initialization to VFIO binding code. This doesn't bode well for when
VFIO container cannot be initialized for whatever reason, because
it results in unrecoverable error even if the user didn't set up
VFIO and didn't even want to use it in the first place.

This patch fixes this by moving container initialization into the
code that checks if VFIO is available at runtime. Therefore, any
issues with the container will be known at initialization stage and
VFIO will simply be turned off if container could not be set up.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
lib/librte_eal/linuxapp/eal/eal_pci_vfio.c