fix domain info struct layout

This commit is contained in:
Alex Zenla committed 2024-01-15 19:29:02 -08:00
1 parent 824a55a6a6
commit c9b18fadfd
3 files changed
+4 -2

No files matched your search

+1
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,
+1
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,
+2 -2
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?;