Skip to content

Commit 1f6e5b0

Browse files
committed
build hypercall: get configurations.
1 parent 224fe30 commit 1f6e5b0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/config.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ impl AxVMConfig {
9797
self.name.clone()
9898
}
9999

100+
/// Returns cpu number.
101+
pub fn cpu_num(&self) -> usize {
102+
self.cpu_num
103+
}
104+
100105
/// Returns vCpu id list and its corresponding pCpu affinity list, as well as its physical id.
101106
/// If the pCpu affinity is None, it means the vCpu will be allocated to any available pCpu randomly.
102107
/// if the pCPU id is not provided, the vCpu's physical id will be set as vCpu id.

src/vm.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ impl<H: AxVMHal, U: AxVCpuHal> AxVM<H, U> {
238238
self.inner_mut.address_space.lock().page_table_root()
239239
}
240240

241+
/// Returns a reference to the VM's configuration.
242+
pub fn get_vm_config(&self) -> &AxVMConfig {
243+
&self.inner_const.config
244+
}
245+
241246
/// Returns guest VM image load region in `Vec<&'static mut [u8]>`,
242247
/// according to the given `image_load_gpa` and `image_size.
243248
/// `Vec<&'static mut [u8]>` is a series of (HVA) address segments,

0 commit comments

Comments
 (0)