Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ license = "GPL-3.0-or-later OR Apache-2.0 OR MulanPSL-2.0" # MulanPubL2 is not i
axerrno = "0.1.0"
memory_addr = "0.4"
percpu = "0.2.0"

axaddrspace = "=0.1.0"
axvisor_api = "=0.1.0"
5 changes: 5 additions & 0 deletions src/vcpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ impl<A: AxArchVCpu> AxVCpu<A> {
self.inner_const.vcpu_id
}

/// Get the id of the VM this vcpu belongs to.
pub const fn vm_id(&self) -> VMId {
self.inner_const.vm_id
}

/// Returns the preferred physical CPU for this VCpu.
///
/// This is used for CPU affinity optimization - the scheduler should
Expand Down