From c9b18fadfd657538bb7ee0f13ac1b5896f8b09f9 Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Mon, 15 Jan 2024 19:29:02 -0800 Subject: [PATCH] fix domain info struct layout --- xencall/src/domctl.rs | 1 + xencall/src/sys.rs | 1 + xenclient/examples/boot.rs | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xencall/src/domctl.rs b/xencall/src/domctl.rs index abf1d92..6172558 100644 --- a/xencall/src/domctl.rs +++ b/xencall/src/domctl.rs @@ -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, diff --git a/xencall/src/sys.rs b/xencall/src/sys.rs index 2ff38ad..ac56ab8 100644 --- a/xencall/src/sys.rs +++ b/xencall/src/sys.rs @@ -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, diff --git a/xenclient/examples/boot.rs b/xenclient/examples/boot.rs index 4d5406a..710681c 100644 --- a/xenclient/examples/boot.rs +++ b/xenclient/examples/boot.rs @@ -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?;