Refactor: move load_vm_config to associated function on VmConfig.
Bug: 171277638
Test: m virtmanager
Change-Id: I94ff72693dc9e1b654827591bd233e95bd35743e
diff --git a/virtmanager/src/aidl.rs b/virtmanager/src/aidl.rs
index 1b3819f..b7595a9 100644
--- a/virtmanager/src/aidl.rs
+++ b/virtmanager/src/aidl.rs
@@ -14,7 +14,7 @@
//! Implementation of the AIDL interface of the Virt Manager.
-use crate::config::load_vm_config;
+use crate::config::VmConfig;
use crate::crosvm::VmInstance;
use crate::{Cid, FIRST_GUEST_CID};
use android_system_virtmanager::aidl::android::system::virtmanager::IVirtManager::IVirtManager;
@@ -141,7 +141,7 @@
/// Start a new VM instance from the given VM config filename. This assumes the VM is not already
/// running.
fn start_vm(config_path: &str, cid: Cid) -> binder::Result<VmInstance> {
- let config = load_vm_config(config_path).map_err(|e| {
+ let config = VmConfig::load(config_path).map_err(|e| {
error!("Failed to load VM config {}: {:?}", config_path, e);
StatusCode::BAD_VALUE
})?;