remove support of multi-file partition
This is a non-trivial revert of 9713bd4664034f4a0c2f8ffbb289bd19481d4800
and 1fee0d8da6bb440127861e278a7dad09b7f506fd.
Bug: n/a
Test: atest MicrodroidHostTestCases
Change-Id: I2cd549ddbdb2c28c251697789c101d0af1885fdf
diff --git a/vmconfig/src/lib.rs b/vmconfig/src/lib.rs
index 7739e36..3828742 100644
--- a/vmconfig/src/lib.rs
+++ b/vmconfig/src/lib.rs
@@ -131,8 +131,7 @@
/// A label for the partition.
pub label: String,
/// The filename of the partition image.
- #[serde(default)]
- pub paths: Vec<PathBuf>,
+ pub path: PathBuf,
/// Whether the partition should be writable.
#[serde(default)]
pub writable: bool,
@@ -140,15 +139,11 @@
impl Partition {
fn to_parcelable(&self) -> Result<AidlPartition> {
- if self.paths.is_empty() {
- bail!("Partition {} contains no paths", &self.label);
- }
- let images = self
- .paths
- .iter()
- .map(|path| open_parcel_file(path, self.writable))
- .collect::<Result<Vec<_>, _>>()?;
- Ok(AidlPartition { images, writable: self.writable, label: self.label.to_owned() })
+ Ok(AidlPartition {
+ image: Some(open_parcel_file(&self.path, self.writable)?),
+ writable: self.writable,
+ label: self.label.to_owned(),
+ })
}
}