Merge "Allow changing VM name on configuration" into main am: 7831017bb4 am: a5b9c0490d

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Virtualization/+/3331777

Change-Id: I8be026c8f112d901d913d6714b38517b89188bcf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/guest/trusty/security_vm/launcher/src/main.rs b/guest/trusty/security_vm/launcher/src/main.rs
index c5cc6b4..bdb4ed8 100644
--- a/guest/trusty/security_vm/launcher/src/main.rs
+++ b/guest/trusty/security_vm/launcher/src/main.rs
@@ -34,6 +34,14 @@
     /// Whether the VM is protected or not.
     #[arg(long)]
     protected: bool,
+
+    /// Name of the VM. Used to pull correct config from early_vms.xml
+    #[arg(long, default_value = "trusty_security_vm_launcher")]
+    name: String,
+
+    /// Memory size of the VM in MiB
+    #[arg(long, default_value_t = 128)]
+    memory_size_mib: i32,
 }
 
 fn get_service() -> Result<Strong<dyn IVirtualizationService>> {
@@ -51,10 +59,10 @@
         File::open(&args.kernel).with_context(|| format!("Failed to open {:?}", &args.kernel))?;
 
     let vm_config = VirtualMachineConfig::RawConfig(VirtualMachineRawConfig {
-        name: "trusty_security_vm_launcher".to_owned(),
+        name: args.name.to_owned(),
         kernel: Some(ParcelFileDescriptor::new(kernel)),
         protectedVm: args.protected,
-        memoryMib: 128,
+        memoryMib: args.memory_size_mib,
         platformVersion: "~1.0".to_owned(),
         // TODO: add instanceId
         ..Default::default()