vm run --log <logfile>
Just like run-app command, run supports --log flag to redirect the VM log output. Bug: 218934597 Test: vm run --log <logfile> ... Change-Id: I077a6d22cfc10b4e537b73f8ed0cd7f838a81231
This commit is contained in:
parent
c221c0561b
commit
b7983a2683
|
@ -121,6 +121,10 @@ enum Opt {
|
||||||
/// Path to file for VM console output.
|
/// Path to file for VM console output.
|
||||||
#[structopt(long)]
|
#[structopt(long)]
|
||||||
console: Option<PathBuf>,
|
console: Option<PathBuf>,
|
||||||
|
|
||||||
|
/// Path to file for VM log output.
|
||||||
|
#[structopt(long)]
|
||||||
|
log: Option<PathBuf>,
|
||||||
},
|
},
|
||||||
/// Stop a virtual machine running in the background
|
/// Stop a virtual machine running in the background
|
||||||
Stop {
|
Stop {
|
||||||
|
@ -213,12 +217,13 @@ fn main() -> Result<(), Error> {
|
||||||
cpu_affinity,
|
cpu_affinity,
|
||||||
&extra_idsigs,
|
&extra_idsigs,
|
||||||
),
|
),
|
||||||
Opt::Run { config, daemonize, cpus, cpu_affinity, console } => {
|
Opt::Run { config, daemonize, cpus, cpu_affinity, console, log } => {
|
||||||
command_run(
|
command_run(
|
||||||
service,
|
service,
|
||||||
&config,
|
&config,
|
||||||
daemonize,
|
daemonize,
|
||||||
console.as_deref(),
|
console.as_deref(),
|
||||||
|
log.as_deref(),
|
||||||
/* mem */ None,
|
/* mem */ None,
|
||||||
cpus,
|
cpus,
|
||||||
cpu_affinity,
|
cpu_affinity,
|
||||||
|
|
|
@ -117,11 +117,13 @@ pub fn command_run_app(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Run a VM from the given configuration file.
|
/// Run a VM from the given configuration file.
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn command_run(
|
pub fn command_run(
|
||||||
service: Strong<dyn IVirtualizationService>,
|
service: Strong<dyn IVirtualizationService>,
|
||||||
config_path: &Path,
|
config_path: &Path,
|
||||||
daemonize: bool,
|
daemonize: bool,
|
||||||
console_path: Option<&Path>,
|
console_path: Option<&Path>,
|
||||||
|
log_path: Option<&Path>,
|
||||||
mem: Option<u32>,
|
mem: Option<u32>,
|
||||||
cpus: Option<u32>,
|
cpus: Option<u32>,
|
||||||
cpu_affinity: Option<String>,
|
cpu_affinity: Option<String>,
|
||||||
|
@ -142,7 +144,7 @@ pub fn command_run(
|
||||||
&format!("{:?}", config_path),
|
&format!("{:?}", config_path),
|
||||||
daemonize,
|
daemonize,
|
||||||
console_path,
|
console_path,
|
||||||
None,
|
log_path,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue