Skip to content

Commit 5667bbe

Browse files
committed
kvm: label x86 and x86_64 specific code
Signed-off-by: Diana Popa <[email protected]>
1 parent e77ecb8 commit 5667bbe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kvm/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,11 @@ impl Kvm {
185185
// Safe because we verify the value of ret and we are the owners of the fd.
186186
let vm_file = unsafe { File::from_raw_fd(ret) };
187187
let run_mmap_size = self.get_vcpu_mmap_size()?;
188+
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
188189
let kvm_cpuid: CpuId = self.get_supported_cpuid(MAX_KVM_CPUID_ENTRIES)?;
189190
Ok(VmFd {
190191
vm: vm_file,
192+
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
191193
supported_cpuid: kvm_cpuid,
192194
run_size: run_mmap_size,
193195
})
@@ -222,11 +224,13 @@ impl Into<u64> for NoDatamatch {
222224
/// A wrapper around creating and using a VM.
223225
pub struct VmFd {
224226
vm: File,
227+
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
225228
supported_cpuid: CpuId,
226229
run_size: usize,
227230
}
228231

229232
impl VmFd {
233+
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
230234
/// Returns a clone of the system supported CPUID values associated with this VmFd
231235
///
232236
pub fn get_supported_cpuid(&self) -> CpuId {

0 commit comments

Comments
 (0)