fix domain info struct layout

This commit is contained in:
Alex Zenla 2024-01-15 19:29:02 -08:00
parent 824a55a6a6
commit c9b18fadfd
No known key found for this signature in database
GPG Key ID: 067B238899B51269
3 changed files with 4 additions and 2 deletions

View File

@ -44,6 +44,7 @@ impl DomainControl<'_> {
shr_pages: 0,
paged_pages: 0,
shared_info_frame: 0,
cpu_time: 0,
number_online_vcpus: 0,
max_vcpu_id: 0,
ssidref: 0,

View File

@ -278,6 +278,7 @@ pub struct GetDomainInfo {
pub shr_pages: u64,
pub paged_pages: u64,
pub shared_info_frame: u64,
pub cpu_time: u64,
pub number_online_vcpus: u32,
pub max_vcpu_id: u32,
pub ssidref: u32,

View File

@ -18,8 +18,8 @@ fn main() -> Result<(), XenClientError> {
let kernel_image_path = args.get(1).expect("argument not specified");
let call = XenCall::open()?;
let domctl = DomainControl::new(&call);
let domid = domctl.create_domain(CreateDomain::default())?;
domctl.set_max_vcpus(domid, 1)?;
let domain = CreateDomain { max_vcpus: 2, ..Default::default() };
let domid = domctl.create_domain(domain)?;
let result = boot(domid, kernel_image_path.as_str(), &call, &domctl);
domctl.destroy_domain(domid)?;
result?;