hypervisor: cpu: Rename state getter and setter

vcpu.{set_}cpu_state() is a stutter.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz
2020-07-03 10:54:36 +02:00
committed by Rob Bradford
parent a3342bdb25
commit 618722cdca
3 changed files with 14 additions and 13 deletions

View File

@@ -403,7 +403,7 @@ const VCPU_SNAPSHOT_ID: &str = "vcpu";
impl Pausable for Vcpu {
fn pause(&mut self) -> std::result::Result<(), MigratableError> {
self.saved_state =
Some(self.fd.cpu_state().map_err(|e| {
Some(self.fd.state().map_err(|e| {
MigratableError::Pause(anyhow!("Could not get vCPU state {:?}", e))
})?);
@@ -412,7 +412,7 @@ impl Pausable for Vcpu {
fn resume(&mut self) -> std::result::Result<(), MigratableError> {
if let Some(vcpu_state) = &self.saved_state {
self.fd.set_cpu_state(vcpu_state).map_err(|e| {
self.fd.set_state(vcpu_state).map_err(|e| {
MigratableError::Pause(anyhow!("Could not set the vCPU state {:?}", e))
})?;
}