Bind devices to VFIO with VirtualizationService
vfio_handler service is added, which is a minimal service for tasks
which should be done as root. It will interact to sysfs to bind
VFIO devices.
Bug: 287379025
Bug: 278008182
Test: adb shell /apex/com.android.virt/bin/vm run-microdroid \
--devices /sys/bus/platform/devices/16d00000.eh --protected
Change-Id: Ia99f2be86c33b171297f76f7e30eacfc083aeaa0
diff --git a/apex/Android.bp b/apex/Android.bp
index 7ef2c79..765372a 100644
--- a/apex/Android.bp
+++ b/apex/Android.bp
@@ -76,6 +76,7 @@
arm64: {
binaries: [
"crosvm",
+ "vfio_handler",
"virtmgr",
"virtualizationservice",
],
@@ -84,6 +85,7 @@
x86_64: {
binaries: [
"crosvm",
+ "vfio_handler",
"virtmgr",
"virtualizationservice",
],
diff --git a/apex/virtualizationservice.rc b/apex/virtualizationservice.rc
index 02b2081..be90904 100644
--- a/apex/virtualizationservice.rc
+++ b/apex/virtualizationservice.rc
@@ -19,3 +19,10 @@
interface aidl android.system.virtualizationservice
disabled
oneshot
+
+service vfio_handler /apex/com.android.virt/bin/vfio_handler
+ user root
+ group root
+ interface aidl android.system.virtualizationservice_internal.IVfioHandler
+ disabled
+ oneshot