Rename VirtManager to VirtualizationService in a few more places.
Bug: 188042280
Test: mm
Change-Id: I4f1c312f484b412aee2884ff04378e3fefee1cc7
diff --git a/apex/Android.bp b/apex/Android.bp
index 4386e6e..9c0ef23 100644
--- a/apex/Android.bp
+++ b/apex/Android.bp
@@ -52,7 +52,8 @@
"mk_payload",
],
apps: [
- // TODO(jiyong): remove this when microdroid_payload.json is created by virt manager
+ // TODO(jiyong): remove this when microdroid_payload.json is created by
+ // VirtualizationService.
"MicrodroidTestApp",
],
prebuilts: [
diff --git a/virtualizationservice/src/main.rs b/virtualizationservice/src/main.rs
index cf0be38..a68e5eb 100644
--- a/virtualizationservice/src/main.rs
+++ b/virtualizationservice/src/main.rs
@@ -37,12 +37,12 @@
android_logger::Config::default().with_tag(LOG_TAG).with_min_level(Level::Trace),
);
- let virt_manager = VirtualizationService::default();
- let virt_manager = BnVirtualizationService::new_binder(
- virt_manager,
+ let service = VirtualizationService::default();
+ let service = BnVirtualizationService::new_binder(
+ service,
BinderFeatures { set_requesting_sid: true, ..BinderFeatures::default() },
);
- add_service(BINDER_SERVICE_IDENTIFIER, virt_manager.as_binder()).unwrap();
+ add_service(BINDER_SERVICE_IDENTIFIER, service.as_binder()).unwrap();
info!("Registered Binder service, joining threadpool.");
ProcessState::join_thread_pool();
}
diff --git a/vm/src/main.rs b/vm/src/main.rs
index 56a0c92..84f7d18 100644
--- a/vm/src/main.rs
+++ b/vm/src/main.rs
@@ -26,7 +26,8 @@
use structopt::clap::AppSettings;
use structopt::StructOpt;
-const VIRT_MANAGER_BINDER_SERVICE_IDENTIFIER: &str = "android.system.virtualizationservice";
+const VIRTUALIZATION_SERVICE_BINDER_SERVICE_IDENTIFIER: &str =
+ "android.system.virtualizationservice";
#[derive(StructOpt)]
#[structopt(no_version, global_settings = &[AppSettings::DisableVersion])]
@@ -57,19 +58,19 @@
// We need to start the thread pool for Binder to work properly, especially link_to_death.
ProcessState::start_thread_pool();
- let virt_manager = get_interface(VIRT_MANAGER_BINDER_SERVICE_IDENTIFIER)
+ let service = get_interface(VIRTUALIZATION_SERVICE_BINDER_SERVICE_IDENTIFIER)
.context("Failed to find VirtualizationService")?;
match opt {
- Opt::Run { config, daemonize } => command_run(virt_manager, &config, daemonize),
- Opt::Stop { cid } => command_stop(virt_manager, cid),
- Opt::List => command_list(virt_manager),
+ Opt::Run { config, daemonize } => command_run(service, &config, daemonize),
+ Opt::Stop { cid } => command_stop(service, cid),
+ Opt::List => command_list(service),
}
}
/// Retrieve reference to a previously daemonized VM and stop it.
-fn command_stop(virt_manager: Strong<dyn IVirtualizationService>, cid: u32) -> Result<(), Error> {
- virt_manager
+fn command_stop(service: Strong<dyn IVirtualizationService>, cid: u32) -> Result<(), Error> {
+ service
.debugDropVmRef(cid as i32)
.context("Failed to get VM from VirtualizationService")?
.context("CID does not correspond to a running background VM")?;
@@ -77,8 +78,8 @@
}
/// List the VMs currently running.
-fn command_list(virt_manager: Strong<dyn IVirtualizationService>) -> Result<(), Error> {
- let vms = virt_manager.debugListVms().context("Failed to get list of VMs")?;
+fn command_list(service: Strong<dyn IVirtualizationService>) -> Result<(), Error> {
+ let vms = service.debugListVms().context("Failed to get list of VMs")?;
println!("Running VMs: {:#?}", vms);
Ok(())
}
diff --git a/vm/src/run.rs b/vm/src/run.rs
index 6ac66f1..ab4222f 100644
--- a/vm/src/run.rs
+++ b/vm/src/run.rs
@@ -33,7 +33,7 @@
/// Run a VM from the given configuration file.
pub fn command_run(
- virt_manager: Strong<dyn IVirtualizationService>,
+ service: Strong<dyn IVirtualizationService>,
config_path: &Path,
daemonize: bool,
) -> Result<(), Error> {
@@ -42,7 +42,7 @@
VmConfig::load(&config_file).context("Failed to parse config file")?.to_parcelable()?;
let stdout =
if daemonize { None } else { Some(ParcelFileDescriptor::new(duplicate_stdout()?)) };
- let vm = virt_manager.startVm(&config, stdout.as_ref()).context("Failed to start VM")?;
+ let vm = service.startVm(&config, stdout.as_ref()).context("Failed to start VM")?;
let cid = vm.getCid().context("Failed to get CID")?;
println!("Started VM from {:?} with CID {}.", config_path, cid);
@@ -50,7 +50,7 @@
if daemonize {
// Pass the VM reference back to VirtualizationService and have it hold it in the
// background.
- virt_manager.debugHoldVmRef(&vm).context("Failed to pass VM to VirtualizationService")
+ service.debugHoldVmRef(&vm).context("Failed to pass VM to VirtualizationService")
} else {
// Wait until the VM or VirtualizationService dies. If we just returned immediately then the
// IVirtualMachine Binder object would be dropped and the VM would be killed.