Create full VM DTBO only once under /data/misc/virtualizationservice
Bug: 297103622
Test: adb shell /apex/com.android.virt/bin/vm run-microdroid --devices /sys/bus/platform/devices/16d00000.eh --protected
Change-Id: I4a6e7b7928edb93b6707202a9cc205fcf3994444
diff --git a/virtualizationservice/src/main.rs b/virtualizationservice/src/main.rs
index 3af0d42..18b026d 100644
--- a/virtualizationservice/src/main.rs
+++ b/virtualizationservice/src/main.rs
@@ -28,8 +28,9 @@
use anyhow::Error;
use binder::{register_lazy_service, BinderFeatures, ProcessState, ThreadState};
use log::{info, Level};
-use std::fs::read_dir;
+use std::fs::{create_dir, read_dir};
use std::os::unix::raw::{pid_t, uid_t};
+use std::path::Path;
const LOG_TAG: &str = "VirtualizationService";
@@ -56,6 +57,9 @@
clear_temporary_files().expect("Failed to delete old temporary files");
+ let common_dir_path = Path::new(TEMPORARY_DIRECTORY).join("common");
+ create_dir(common_dir_path).expect("Failed to create common directory");
+
ProcessState::start_thread_pool();
let service = VirtualizationServiceInternal::init();