Implement platform API to assign devices
Clients can specify either device types or sysfs nodes when creating a
VM. The app should have USE_CUSTOM_VIRTUAL_MACHINE permission to do so.
Bug: 287379025
Test: TH
Test: adb root && adb shell /apex/com.android.virt/bin/vm \
run-microdroid --devices /sys/bus/platform/devices/16d00000.eh \
--protected
Change-Id: I375d455fa1fa9cbad6e552cdb7b3e9a2138f9278
diff --git a/virtualizationservice/src/rkpvm.rs b/virtualizationservice/src/rkpvm.rs
index ebfb667..63160f4 100644
--- a/virtualizationservice/src/rkpvm.rs
+++ b/virtualizationservice/src/rkpvm.rs
@@ -76,8 +76,8 @@
memoryMib: 300,
cpuTopology: CpuTopology::ONE_CPU,
platformVersion: "~1.0".to_string(),
- taskProfiles: vec![],
gdbPort: 0, // No gdb
+ ..Default::default()
});
let vm = VmInstance::create(service.as_ref(), &config, None, None, None, None)
.context("Failed to create service VM")?;