This code around vfio in setup script looks incorrect, is anyone using it:

1. Why set the execute bit, when you want read-write?
   Looks like a bug (or worse a security hole).
        # make sure regular users can read /dev/vfio
        echo "chmod /dev/vfio"
        sudo chmod a+x /dev/vfio

3. Why depend on location of vfio module in kernel tree?
   modprobe does the right thing and finds it.

        VFIO_PATH="kernel/drivers/vfio/pci/vfio-pci.ko"

        echo "Loading VFIO module"
        /sbin/lsmod | grep -s vfio_pci > /dev/null
        if [ $? -ne 0 ] ; then
                if [ -f /lib/modules/$(uname -r)/$VFIO_PATH ] ; then
                        sudo /sbin/modprobe vfio-pci
                fi
        fi


Reply via email to