mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
vmm: Move VM boot events to Vmm::vm_boot
Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
parent
55678b23ba
commit
5997cfacbf
@ -1216,6 +1216,8 @@ impl RequestHandler for Vmm {
|
|||||||
|
|
||||||
fn vm_boot(&mut self) -> result::Result<(), VmError> {
|
fn vm_boot(&mut self) -> result::Result<(), VmError> {
|
||||||
tracer::start();
|
tracer::start();
|
||||||
|
info!("Booting VM");
|
||||||
|
event!("vm", "booting");
|
||||||
let r = {
|
let r = {
|
||||||
trace_scoped!("vm_boot");
|
trace_scoped!("vm_boot");
|
||||||
// If we don't have a config, we can not boot a VM.
|
// If we don't have a config, we can not boot a VM.
|
||||||
@ -1269,6 +1271,9 @@ impl RequestHandler for Vmm {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
tracer::end();
|
tracer::end();
|
||||||
|
if r.is_ok() {
|
||||||
|
event!("vm", "booted");
|
||||||
|
}
|
||||||
r
|
r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2067,8 +2067,6 @@ impl Vm {
|
|||||||
|
|
||||||
pub fn boot(&mut self) -> Result<()> {
|
pub fn boot(&mut self) -> Result<()> {
|
||||||
trace_scoped!("Vm::boot");
|
trace_scoped!("Vm::boot");
|
||||||
info!("Booting VM");
|
|
||||||
event!("vm", "booting");
|
|
||||||
let current_state = self.get_state()?;
|
let current_state = self.get_state()?;
|
||||||
if current_state == VmState::Paused {
|
if current_state == VmState::Paused {
|
||||||
return self.resume().map_err(Error::Resume);
|
return self.resume().map_err(Error::Resume);
|
||||||
@ -2185,7 +2183,6 @@ impl Vm {
|
|||||||
|
|
||||||
let mut state = self.state.try_write().map_err(|_| Error::PoisonedState)?;
|
let mut state = self.state.try_write().map_err(|_| Error::PoisonedState)?;
|
||||||
*state = new_state;
|
*state = new_state;
|
||||||
event!("vm", "booted");
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user