vmm: Retry running a CPU when getting EAGAIN or EINTR from the run ioctl

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz 2019-03-12 14:55:35 +01:00
parent 25f4063da6
commit 0b6ec34505

View File

@ -414,12 +414,19 @@ impl<'a> Vm<'a> {
VcpuExit::IoapicEoi => {}
VcpuExit::Hyperv => {}
},
Err(e) => {
Err(Error::VcpuRun(ref e)) => {
match e.raw_os_error().unwrap() {
// Why do we check for these if we only return EINVAL?
libc::EAGAIN | libc::EINTR => {}
_ => {
println! {"VCPU {:?} error {:?}", cpu_id, e};
break;
}
}
}
_ => (),
}
}
})
.map_err(Error::VcpuSpawn)?,
);