vmm: Rename Booted vm state to Running

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz 2019-10-10 18:00:44 +02:00 committed by Sebastien Boeuf
parent dbbd04a4cf
commit d2d3abb13c
2 changed files with 9 additions and 9 deletions

View File

@ -231,7 +231,7 @@ impl Vmm {
if let Some(ref mut vm) = self.vm { if let Some(ref mut vm) = self.vm {
vm.pause() vm.pause()
} else { } else {
Err(VmError::VmNotBooted) Err(VmError::VmNotRunning)
} }
} }
@ -239,7 +239,7 @@ impl Vmm {
if let Some(ref mut vm) = self.vm { if let Some(ref mut vm) = self.vm {
vm.resume() vm.resume()
} else { } else {
Err(VmError::VmNotBooted) Err(VmError::VmNotRunning)
} }
} }
@ -247,7 +247,7 @@ impl Vmm {
if let Some(ref mut vm) = self.vm.take() { if let Some(ref mut vm) = self.vm.take() {
vm.shutdown() vm.shutdown()
} else { } else {
Err(VmError::VmNotBooted) Err(VmError::VmNotRunning)
} }
} }

View File

@ -213,8 +213,8 @@ pub enum Error {
/// VM is not created /// VM is not created
VmNotCreated, VmNotCreated,
/// VM is not bootted /// VM is not running
VmNotBooted, VmNotRunning,
/// Cannot clone EventFd. /// Cannot clone EventFd.
EventFdClone(io::Error), EventFdClone(io::Error),
@ -439,7 +439,7 @@ pub struct VmInfo<'a> {
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub enum VmState { pub enum VmState {
Created, Created,
Booted, Running,
Shutdown, Shutdown,
Paused, Paused,
} }
@ -843,9 +843,9 @@ impl Vm {
vcpu_thread.thread().unpark(); vcpu_thread.thread().unpark();
} }
// And we're back to Booted state. // And we're back to the Running state.
let mut state = self.state.try_write().map_err(|_| Error::PoisonedState)?; let mut state = self.state.try_write().map_err(|_| Error::PoisonedState)?;
*state = VmState::Booted; *state = VmState::Running;
Ok(()) Ok(())
} }
@ -965,7 +965,7 @@ 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 = VmState::Booted; *state = VmState::Running;
Ok(()) Ok(())
} }