]> git.proxmox.com Git - ovs.git/commitdiff
redhat: add vfio udev rules
authoraaron conole <aconole@redhat.com>
Wed, 9 Aug 2017 20:36:53 +0000 (16:36 -0400)
committerRussell Bryant <russell@ovn.org>
Thu, 10 Aug 2017 18:18:39 +0000 (14:18 -0400)
This commit builds on the non-root ovs work and adds a udev rule which will
automatically set the group permissions of vfio devices.

Fixes: e3e738a3d058 ("redhat: allow dpdk to also run as non-root user")
Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
rhel/automake.mk
rhel/openvswitch-fedora.spec.in
rhel/usr_lib_udev_rules.d_91-vfio.rules [new file with mode: 0644]

index 11c8be0e693cd83b1016ff69a92ff6c53f8d8c0a..1d1ac1a135a7f68f883a2ccfcd9d2fd7566a4629 100644 (file)
@@ -26,6 +26,7 @@ EXTRA_DIST += \
        rhel/openvswitch-fedora.spec.in \
        rhel/usr_share_openvswitch_scripts_sysconfig.template \
        rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
+       rhel/usr_lib_udev_rules.d_91-vfio.rules \
        rhel/usr_lib_systemd_system_openvswitch.service \
        rhel/usr_lib_systemd_system_ovsdb-server.service \
        rhel/usr_lib_systemd_system_ovs-vswitchd.service.in \
index 2eccada21dc461e00fffc443f94421378e5410e7..59e8ff8bbd10e3fa9d1bd1625a28aa7538a11437 100644 (file)
@@ -250,6 +250,11 @@ install -d -m 0755 $RPM_BUILD_ROOT%{_rundir}/openvswitch
 install -d -m 0750 $RPM_BUILD_ROOT%{_localstatedir}/log/openvswitch
 install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch
 
+%if %{with dpdk}
+install -p -D -m 0644 rhel/usr_lib_udev_rules.d_91-vfio.rules \
+        $RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d/91-vfio.rules
+%endif
+
 install -p -D -m 0644 \
         rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
         $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch
@@ -566,6 +571,9 @@ fi
 %{_mandir}/man8/ovs-vswitchd.8*
 %{_mandir}/man8/ovs-parse-backtrace.8*
 %{_mandir}/man8/ovs-testcontroller.8*
+%if %{with dpdk}
+%{_prefix}/lib/udev/rules.d/91-vfio.rules
+%endif
 %doc COPYING NOTICE README.rst NEWS rhel/README.RHEL.rst
 /var/lib/openvswitch
 /var/log/openvswitch
diff --git a/rhel/usr_lib_udev_rules.d_91-vfio.rules b/rhel/usr_lib_udev_rules.d_91-vfio.rules
new file mode 100644 (file)
index 0000000..8e34b2a
--- /dev/null
@@ -0,0 +1 @@
+ACTION=="add", SUBSYSTEM=="vfio*", GROUP="hugetlbfs", MODE="0660"