implement support for creating domains

This commit is contained in:
Alex Zenla
2024-01-09 15:40:17 -08:00
parent 4b31d95e43
commit 35f3346858
16 changed files with 618 additions and 105 deletions

View File

@ -1,4 +1,5 @@
mod sys;
pub mod domctl;
pub mod sys;
use crate::sys::Hypercall;
use nix::errno::Errno;
@ -60,9 +61,9 @@ impl XenCall {
pub fn hypercall(&mut self, op: c_ulong, arg: [c_ulong; 5]) -> Result<c_long, XenCallError> {
unsafe {
let mut call = Hypercall { op, arg, retval: 0 };
sys::hypercall(self.handle.as_raw_fd(), &mut call)?;
Ok(call.retval)
let mut call = Hypercall { op, arg };
let result = sys::hypercall(self.handle.as_raw_fd(), &mut call)?;
Ok(result as c_long)
}
}