diff --git a/Cargo.toml b/Cargo.toml index 9758b63..9469972 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/src/vcpu.rs b/src/vcpu.rs index d4600ca..031c586 100644 --- a/src/vcpu.rs +++ b/src/vcpu.rs @@ -137,6 +137,11 @@ impl AxVCpu { 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