Flag guard the code related to the vendor modules feature
The feature is guarded by the RELEASE_AVF_ENABLE_VENDOR_MODULES flag. On
the virtmgr side the flag-guard check is done in the create_vm_internal
function. On the vm binary side the related flags (--vendor, --kernel)
are only enabled if the RELEASE_AVF_ENABLE_VENDOR_MODULES flag is
enabled.
Additionally the vendor modules related tests in MicrodroidTests now run
conditionally depending on the result of the
`isFeatureEnabled(FEATURE_VENDOR_MODULES)` call.
Bug: 298007909
Test: atest MicrodroidTests
Change-Id: I1467194c802720601a10d0a760a8f1d7ce134037
diff --git a/vm/src/run.rs b/vm/src/run.rs
index fc8d7e0..1ba9dec 100644
--- a/vm/src/run.rs
+++ b/vm/src/run.rs
@@ -84,25 +84,25 @@
)?;
}
- let storage = if let Some(path) = config.microdroid.storage {
+ let storage = if let Some(ref path) = config.microdroid.storage {
if !path.exists() {
command_create_partition(
service.as_ref(),
- &path,
+ path,
config.microdroid.storage_size.unwrap_or(10 * 1024 * 1024),
PartitionType::ENCRYPTEDSTORE,
)?;
}
- Some(open_parcel_file(&path, true)?)
+ Some(open_parcel_file(path, true)?)
} else {
None
};
let kernel =
- config.microdroid.kernel.as_ref().map(|p| open_parcel_file(p, false)).transpose()?;
+ config.microdroid.kernel().as_ref().map(|p| open_parcel_file(p, false)).transpose()?;
let vendor =
- config.microdroid.vendor.as_ref().map(|p| open_parcel_file(p, false)).transpose()?;
+ config.microdroid.vendor().as_ref().map(|p| open_parcel_file(p, false)).transpose()?;
let extra_idsig_files: Result<Vec<File>, _> =
config.extra_idsigs.iter().map(File::open).collect();